Skip to content

Commit 5c08015

Browse files
authored
Disable exchanging minimum scores across slices for exhaustive evaluation. (#13954)
When `totalHitsThreshold` is `Integer.MAX_VALUE`, dynamic pruning is never used and all hits get evaluated. Thus, the minimum competitive score always stays at zero, and there is nothing to exchange across slices.
1 parent 618bfa5 commit 5c08015

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lucene/CHANGES.txt

+4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ Optimizations
6565
* GITHUB#13941: Optimized computation of top-hits on disjunctive queries with
6666
many clauses. (Adrien Grand)
6767

68+
* GITHUB#13954: Disabled exchanging scores across slices for exhaustive
69+
top-hits evaluation. (Adrien Grand)
70+
6871
* GITHUB#13899: Check ahead if we can get the count. (Lu Xugang)
6972

73+
7074
Bug Fixes
7175
---------------------
7276
* GITHUB#13832: Fixed an issue where the DefaultPassageFormatter.format method did not format passages as intended

lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ public TopFieldCollectorManager(
9393
supportsConcurrency
9494
? HitsThresholdChecker.createShared(Math.max(totalHitsThreshold, numHits))
9595
: HitsThresholdChecker.create(Math.max(totalHitsThreshold, numHits));
96-
this.minScoreAcc = supportsConcurrency ? new MaxScoreAccumulator() : null;
96+
this.minScoreAcc =
97+
supportsConcurrency && totalHitsThreshold != Integer.MAX_VALUE
98+
? new MaxScoreAccumulator()
99+
: null;
97100
this.collectors = new ArrayList<>();
98101
}
99102

lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ public TopScoreDocCollectorManager(
7575
supportsConcurrency
7676
? HitsThresholdChecker.createShared(Math.max(totalHitsThreshold, numHits))
7777
: HitsThresholdChecker.create(Math.max(totalHitsThreshold, numHits));
78-
this.minScoreAcc = supportsConcurrency ? new MaxScoreAccumulator() : null;
78+
this.minScoreAcc =
79+
supportsConcurrency && totalHitsThreshold != Integer.MAX_VALUE
80+
? new MaxScoreAccumulator()
81+
: null;
7982
}
8083

8184
/**

0 commit comments

Comments
 (0)