You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2025/07/22 16:52:37 UTC

(lucene) branch branch_10x updated: Utilize docIDRunEnd on ReqExclBulkScorer (#14976)

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

dweiss 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 7dd51f8c83c Utilize docIDRunEnd on ReqExclBulkScorer (#14976)
7dd51f8c83c is described below

commit 7dd51f8c83ca2d54923843da942165b3a164734e
Author: Samuel.G <11...@qq.com>
AuthorDate: Wed Jul 23 01:52:03 2025 +0900

    Utilize docIDRunEnd on ReqExclBulkScorer (#14976)
---
 lucene/CHANGES.txt                                                   | 2 ++
 lucene/core/src/java/org/apache/lucene/search/ReqExclBulkScorer.java | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index d580dccef1b..72631b09840 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -124,6 +124,8 @@ Optimizations
 
 * GITHUB#14896: Vectorize filterCompetitiveHits (Ge Song, Adrien Grand)
 
+* GITHUB#14976: Utilize docIdRunEnd on ReqExclBulkScorer. (Ge Song)
+
 Changes in Runtime Behavior
 ---------------------
 * GITHUB#14823: Decrease TieredMergePolicy's default number of segments per
diff --git a/lucene/core/src/java/org/apache/lucene/search/ReqExclBulkScorer.java b/lucene/core/src/java/org/apache/lucene/search/ReqExclBulkScorer.java
index 7c07ef0386d..da665c0dd95 100644
--- a/lucene/core/src/java/org/apache/lucene/search/ReqExclBulkScorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/ReqExclBulkScorer.java
@@ -57,7 +57,10 @@ final class ReqExclBulkScorer extends BulkScorer {
         exclDoc = exclApproximation.advance(upTo);
       }
       if (exclDoc == upTo) {
-        if (exclTwoPhase == null || exclTwoPhase.matches()) {
+        if (exclTwoPhase == null) {
+          // from upTo to docIdRunEnd() are excluded, so we scored up to docIdRunEnd()
+          upTo = Math.min(exclApproximation.docIDRunEnd(), max);
+        } else if (exclTwoPhase.matches()) {
           // upTo is excluded so we can consider that we scored up to upTo+1
           upTo += 1;
         }