Skip to content

Apache Lucene open-source search software

Disable exchanging minimum scores across slices for exhaustive evaluation. (#13954)

Adrien Grand5c080156f57b
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9da41e6e4cb..f3e359b7630 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -65,8 +65,12 @@ Optimizations
* GITHUB#13941: Optimized computation of top-hits on disjunctive queries with
many clauses. (Adrien Grand)
+* GITHUB#13954: Disabled exchanging scores across slices for exhaustive
+ top-hits evaluation. (Adrien Grand)
+
* GITHUB#13899: Check ahead if we can get the count. (Lu Xugang)
+
Bug Fixes
---------------------
* GITHUB#13832: Fixed an issue where the DefaultPassageFormatter.format method did not format passages as intended
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
index d09a589be97..2d4a0c0e215 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java
@@ -93,7 +93,10 @@ public class TopFieldCollectorManager implements CollectorManager<TopFieldCollec
supportsConcurrency
? HitsThresholdChecker.createShared(Math.max(totalHitsThreshold, numHits))
: HitsThresholdChecker.create(Math.max(totalHitsThreshold, numHits));
- this.minScoreAcc = supportsConcurrency ? new MaxScoreAccumulator() : null;
+ this.minScoreAcc =
+ supportsConcurrency && totalHitsThreshold != Integer.MAX_VALUE
+ ? new MaxScoreAccumulator()
+ : null;
this.collectors = new ArrayList<>();
}
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
index 4e3181abdf7..94a4e1a82d3 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollectorManager.java
@@ -75,7 +75,10 @@ public class TopScoreDocCollectorManager
supportsConcurrency
? HitsThresholdChecker.createShared(Math.max(totalHitsThreshold, numHits))
: HitsThresholdChecker.create(Math.max(totalHitsThreshold, numHits));
- this.minScoreAcc = supportsConcurrency ? new MaxScoreAccumulator() : null;
+ this.minScoreAcc =
+ supportsConcurrency && totalHitsThreshold != Integer.MAX_VALUE
+ ? new MaxScoreAccumulator()
+ : null;
}
/**