You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2024/10/25 12:02:38 UTC

(lucene) branch branch_10x updated: Disable exchanging minimum scores across slices for exhaustive evaluation. (#13954)

This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_10x by this push:
     new 9fb87b606ba Disable exchanging minimum scores across slices for exhaustive evaluation. (#13954)
9fb87b606ba is described below

commit 9fb87b606bae38f94cbf42b2359b25207d1715cb
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Fri Oct 25 14:02:04 2024 +0200

    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.
---
 lucene/CHANGES.txt                                                   | 4 ++++
 .../src/java/org/apache/lucene/search/TopFieldCollectorManager.java  | 5 ++++-
 .../java/org/apache/lucene/search/TopScoreDocCollectorManager.java   | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 0e615b95f8f..31add884885 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -39,8 +39,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;
   }
 
   /**