neural-search
neural-search copied to clipboard
Block query execution if hybrid query is part of the compound query
Is your feature request related to a problem?
Currently it's possible to include hybrid query as part of the most of compound queries, like function_score
. That is a problem as resulting scores are incorrect. This is because hybrid query designed in a way that it must be a top level query.
What solution would you like?
We need to block query execution for cases when Hybrid query is included as part of the compound query . This is already done for Bool
query, but not for other queries. This is the list of such queries for OpenSearch https://opensearch.org/docs/latest/query-dsl/compound/index/:
- boosting
- constant_score
- dis_max
- function_score
What alternatives have you considered?
Execute queries separately and do normalization outside the opensearch.
Do you have any additional context?
Initial issue came up in scope of https://github.com/opensearch-project/neural-search/issues/466, and has been closed for Bool
in a corresponding PR https://github.com/opensearch-project/neural-search/pull/498