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

(lucene) branch branch_10_2 updated: Advance doc instead of offset in competitive iterator (#14530)

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

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


The following commit(s) were added to refs/heads/branch_10_2 by this push:
     new 02cf96b8f7c Advance doc instead of offset in competitive iterator (#14530)
02cf96b8f7c is described below

commit 02cf96b8f7c87fdf5eab864bfc242d36aa2086e7
Author: Guo Feng <52...@users.noreply.github.com>
AuthorDate: Tue Apr 22 12:48:07 2025 +0800

    Advance doc instead of offset in competitive iterator (#14530)
---
 lucene/CHANGES.txt                                                    | 2 +-
 .../org/apache/lucene/search/comparators/TermOrdValComparator.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9e9ec104c7b..80075b8f2dd 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -11,7 +11,7 @@ Bug Fixes
 * GITHUB#14522: Fix DISIDocIdStream::count so that it does not try to count beyond max.
   (Chris Hegarty)
 
-* GITHUB#14523: Correct TermOrdValComparator competitive iterator so that it forces sparse
+* GITHUB#14523, GITHUB#14530: Correct TermOrdValComparator competitive iterator so that it forces sparse
   field iteration to be at least scoring window baseline when doing intoBitSet. (Ben Trent, Adrien Grand)
 
 ======================= Lucene 10.2.0 =======================
diff --git a/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java b/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java
index 0500859d909..2e63fdf68c4 100644
--- a/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java
+++ b/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java
@@ -538,8 +538,8 @@ public class TermOrdValComparator extends FieldComparator<BytesRef> {
       if (disjunction == null) {
         if (docsWithField != null) {
           // we need to be absolutely sure that the iterator is at least at offset
-          if (docsWithField.docID() < offset) {
-            docsWithField.advance(offset);
+          if (docsWithField.docID() < doc) {
+            docsWithField.advance(doc);
           }
           docsWithField.intoBitSet(upTo, bitSet, offset);
           doc = docsWithField.docID();