opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.

Home Page:https://opendistro.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Is it possible to define score in response as max score for individual vectors?

yana2301 opened this issue · comments

Hello, I have a question on score calculation for approximate and exact search.

I've noticed that for queries that contain multiple vectors, the score is defined as the sum of scores for individual vectors.

Example query for approximate search:
{ "query": { "bool" : { "should" : [ { "knn": { "my_vector2": { "vector": [2, 3, 5, 6], "k": 2 } }}, { "knn": { "my_vector2": { "vector": [7, 8, 9, 10], "k": 2 } } } ], "minimum_should_match" : 1, "boost" : 1.0 } } }

For each document in response:
score = score for vector 1 + score for vector 2
The same situation with exact search.
My question is: is there a way to define response score as:
max(score for vector 1, score for vector 2) ?

Hi @yana2301 ,

Sorry for the delay.

I think you may be able to use the Disjunctive Max Query.