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

[Feature Request] function_score should support skipping non-competitive documents when track_total_hits is false #17045

Open
jhinch-at-atlassian-com opened this issue Jan 16, 2025 · 0 comments
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance untriaged

Comments

@jhinch-at-atlassian-com

Is your feature request related to a problem? Please describe

It seems that when using a function_score query for a search, no performance improvements can be observed from setting track_total_hits to false. This is because:

  • FunctionScoreQuery.createWeight does not take into account non-exhausted ScoreModes, forcing subqueries to be COMPLETE or COMPLETE_NO_SCORES
  • FunctionFactorScorer does not propagate setMinCompetitiveScore to its sub queries

This can be easily observed with a function_score block with no functions

Describe the solution you'd like

Where possible support skipping non-competitive documents

Related component

Search:Performance

Describe alternatives you've considered

No response

Additional context

No response

@jhinch-at-atlassian-com jhinch-at-atlassian-com added enhancement Enhancement or improvement to existing feature or request untriaged labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance untriaged
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant