Advance filter in MaxScoreBulkScorer before calculating window bounds - #16380
Merged
Conversation
MaxScoreBulkScorer uses impacts/advanceShallow to calculate its window bounds, possibly going through several rounds of recalculation before moving to the window and scoring/filtering. This can result in a lot of wasted work if the filter excludes a large initial chunk of the document space which could otherwise be ignored during the bounds calculations. We now advance the filter approximation before doing any bounds computation and readjust the outer window limits accordingly.
Contributor
Author
|
I amended luceneutil to add a '+termFilter' task, and built a wiki index sorted by month. High-freq disjunction queries filtered by month get an ~8% speedup. |
romseygeek
added a commit
that referenced
this pull request
Jul 13, 2026
…#16380) MaxScoreBulkScorer uses impacts/advanceShallow to calculate its window bounds, possibly going through several rounds of recalculation before moving to the window and scoring/filtering. This can result in a lot of wasted work if the filter excludes a large initial chunk of the document space which could otherwise be ignored during the bounds calculations. We now advance the filter approximation before doing any bounds computation and readjust the outer window limits accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MaxScoreBulkScorer uses impacts/advanceShallow to calculate its window bounds, possibly going through several rounds of recalculation before moving to the window and scoring/filtering. This can result in a lot of wasted work if the filter excludes a large initial chunk of the document space which could otherwise be ignored during the bounds calculations.
We now advance the filter approximation before doing any bounds computation and readjust the outer window limits accordingly.