Stop requiring MaxScoreBulkScorer's outer window from having at least INNER_WINDOW_SIZE docs. (#13582)

Currently `MaxScoreBulkScorer` requires its "outer" window to be at least
`WINDOW_SIZE`. The intuition there was that we should make sure we should use
the whole range of the bit set that we are using to collect matches. The
downside is that it may force us to use an upper level in the skip list that
has worse upper bounds for the scores.
This commit is contained in:
Adrien Grand 2024-07-18 11:23:19 +02:00 committed by GitHub
parent 22ca695ef5
commit fff997f801
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -292,6 +292,9 @@ Optimizations
* GITHUB#12100: WordBreakSpellChecker.suggestWordBreaks now does a breadth first search, allowing it to return
better matches with fewer evaluations (hossman)
* GITHUB#13582: Stop requiring MaxScoreBulkScorer's outer window from having at
least INNER_WINDOW_SIZE docs. (Adrien Grand)
Changes in runtime behavior
---------------------

View File

@ -271,11 +271,6 @@ final class MaxScoreBulkScorer extends BulkScorer {
windowMax = (int) Math.min(windowMax, upTo + 1L); // upTo is inclusive
}
// Score at least an entire inner window of docs
windowMax =
Math.max(
windowMax, (int) Math.min(Integer.MAX_VALUE, (long) windowMin + INNER_WINDOW_SIZE));
return windowMax;
}