Skip to content

Commit

Permalink
Revert "Better handle dynamic pruning when the leading clause has a s…
Browse files Browse the repository at this point in the history
…ingle impact block. (apache#13904)"

This reverts commit 5fd4525.
  • Loading branch information
jpountz committed Oct 16, 2024
1 parent 7896588 commit 1faf33a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
4 changes: 0 additions & 4 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ Optimizations
* GITHUB#13800: MaxScoreBulkScorer now recomputes scorer partitions when the
minimum competitive allows for a more favorable partitioning. (Adrien Grand)

* GITHUB#13904: BlockMaxConjunctionBulkScorer can now early exit when the
leading clause has a single impact block (e.g. ConstantScoreQuery).
(Adrien Grand)

Bug Fixes
---------------------
* GITHUB#13832: Fixed an issue where the DefaultPassageFormatter.format method did not format passages as intended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,9 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr

int windowMin = Math.max(lead1.docID(), min);
while (windowMin < max) {
// Use impacts of the least costly scorer to compute windows to keep the per-block overhead
// under control.
// NOTE: windowMax is inclusive.
int windowMax = scorer1.advanceShallow(windowMin);
if (windowMax == DocIdSetIterator.NO_MORE_DOCS) {
// If the query doesn't have impacts anymore, or has a single block for the whole doc ID
// space (e.g. ConstantScoreQuery), then we try to create a block that has ~128 docs of the
// leading clause. This gives us higher chances to exit early based on the maximum scores of
// other clauses.
long windowSize = 128L * maxDoc / Math.max(1, lead1.cost());
windowSize = Math.max(windowSize, 128L);
windowMax = (int) Math.min(Integer.MAX_VALUE, windowMin + windowSize);
}
windowMax = Math.min(windowMax, max - 1);
// Use impacts of the least costly scorer to compute windows
// NOTE: windowMax is inclusive
int windowMax = Math.min(scorers[0].advanceShallow(windowMin), max - 1);

float maxWindowScore = Float.POSITIVE_INFINITY;
if (0 < scorable.minCompetitiveScore) {
Expand Down

0 comments on commit 1faf33a

Please sign in to comment.