Skip to content

Advance filter in MaxScoreBulkScorer before calculating window bounds - #16380

Merged
romseygeek merged 3 commits into
apache:mainfrom
romseygeek:bulk/max-score-filter
Jul 13, 2026
Merged

Advance filter in MaxScoreBulkScorer before calculating window bounds#16380
romseygeek merged 3 commits into
apache:mainfrom
romseygeek:bulk/max-score-filter

Conversation

@romseygeek

Copy link
Copy Markdown
Contributor

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.

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.
@romseygeek

Copy link
Copy Markdown
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
romseygeek merged commit fbac1e1 into apache:main Jul 13, 2026
12 checks passed
@romseygeek
romseygeek deleted the bulk/max-score-filter branch July 13, 2026 12:12
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant