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

Ensure top docs optimization is fully disabled for queries with unbounded max scores. #46139

Merged
merged 1 commit into from
Aug 29, 2019

Conversation

jtibshirani
Copy link
Contributor

Backport of #46105, opening to get a full build.

…nded max scores. (elastic#46105)

When a query contains a mandatory clause that doesn't track the max score per
block, we disable the max score optimization. Previously, we were doing this by
wrapping the collector with a FilterCollector that always returned
ScoreMode.COMPLETE.

However we weren't adjusting totalHitsThreshold, so the collector could still
call Scorer#setMinCompetitiveScore. It is against the method contract to call
setMinCompetitiveScore when the score mode is COMPLETE, and some scorers like
ReqOptSumScorer throw an error in this case.

This commit tries to disable the optimization by always setting
totalHitsThreshold to max int, as opposed to wrapping the collector.
@jtibshirani jtibshirani added >bug :Search/Search Search-related issues that do not fall into other categories backport labels Aug 29, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jtibshirani jtibshirani changed the title Ensure top docs optimization is fully disabled for queries with unbounded max scores. (#46105) Ensure top docs optimization is fully disabled for queries with unbounded max scores. Aug 29, 2019
@jtibshirani jtibshirani merged commit b5d8b36 into elastic:7.x Aug 29, 2019
@jtibshirani jtibshirani deleted the disable-max-score branch August 29, 2019 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport >bug :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants