Skip to content
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

Block query execution if hybrid query is part of the compound query #517

Open
martin-gaievski opened this issue Dec 12, 2023 · 1 comment

Comments

@martin-gaievski
Copy link
Member

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 #466, and has been closed for Bool in a corresponding PR #498

@martin-gaievski martin-gaievski added bug Something isn't working untriaged labels Dec 12, 2023
@navneet1v navneet1v removed bug Something isn't working untriaged labels Dec 13, 2023
@navneet1v navneet1v changed the title [BUG] Block query execution if hybrid query is part of the compound query Block query execution if hybrid query is part of the compound query Dec 13, 2023
@nwatab
Copy link

nwatab commented Jun 16, 2024

I want this feature. I'd like to query

$$( w_{match} \cdot \text{MinMax} (match) + w_{kNN} \cdot \text{MinMax} (kNN) ) \cdot \text{decay}(\sigma)$$

, but I can't. I will alternate it with

$$w_{match} \cdot \text{MinMax} (match \cdot \text{decay} (\sigma)) + w_{kNN} \cdot \text{MinMax} (kNN \cdot \text{decay}(\sigma))$$

, which isn't ideal.

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

No branches or pull requests

3 participants