Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Open
yana2301 opened this issue Aug 16, 2021 · 1 comment
Assignees

Comments

@yana2301
Copy link

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) ?

@jmazanec15
Copy link
Member

Hi @yana2301 ,

Sorry for the delay.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants