-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Rescore queries do not seem to modify relevance scores when used in conjunction with a hybrid query #914
Comments
Hi @arasraj thank you for posting this into the issue. We’ve tested the scenario you described and confirmed that the rescore functionality does not get executed for hybrid queries. Our team is currently investigating potential code changes to support rescore queries in this context. In the meantime, I can suggest a workaround: run hybrid search queries separately and combine the scores outside of OpenSearch. You can include the rescore query as part of each individual query. For score normalization, you have two options: Run all queries, retrieve the max and min scores for each query, then calculate a normalization factor (multiplier) to bring the scores into a [0..1.0] range. Apply this multiplier at the client level. For both methods, note that you’ll need to use a larger size than in a typical hybrid query. This is because, internally, hybrid queries retrieve up to |
Thank you @martin-gaievski for sharing the details. HI @arasraj : Thank you for reporting this issue. @martin-gaievski is actively deep diving into this issue. |
great! thanks for looking into it. @martin-gaievski i can test how these alternative methods will impact latency, but do you have any guesses? We currently have ~50ms latency budget and wouldn't want a 10x retrieval size or running a query with size=0 to add too much extra latency on top of what we have. |
Exact latency will be depending on the dataset and exact queries, my guess it will go above the 50ms mainly because of the additional latency of multiple query layers. |
What is the bug?
When the query dsl contains a
hybrid
section as well as arescore
section, therescore
query does not seem to have any effect on the final doc relevance scores.How can one reproduce the bug?
Add phase result processors:
Example query:
What is the expected behavior?
It is expected that the
rescore
query actually modifies the scores of the sub-query result docs prior to the coordinating node doing score normalization and merging. For the example query above, it is expected that the results from the sub-queries are reordered according to the decay function.What is your host/environment?
AWS managed Opensearch 2.15
The text was updated successfully, but these errors were encountered: