You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/09/28 18:40:22 UTC

[GitHub] [lucene] dnhatn commented on a change in pull request #324: LUCENE-10126: Fix competitiveIterator wrongly skip documents

dnhatn commented on a change in pull request #324:
URL: https://github.com/apache/lucene/pull/324#discussion_r717864552



##########
File path: lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java
##########
@@ -271,30 +271,7 @@ public void visit(int docID, byte[] packedValue) {
 
     @Override
     public DocIdSetIterator competitiveIterator() {
-      if (enableSkipping == false) return null;
-      return new DocIdSetIterator() {
-        private int docID = -1;
-
-        @Override
-        public int nextDoc() throws IOException {
-          return advance(docID + 1);
-        }
-
-        @Override
-        public int docID() {
-          return docID;
-        }
-
-        @Override
-        public long cost() {
-          return competitiveIterator.cost();
-        }
-
-        @Override
-        public int advance(int target) throws IOException {
-          return docID = competitiveIterator.advance(target);
-        }
-      };
+      return enableSkipping ? competitiveIterator : null;

Review comment:
       Good catch. I've reverted this change. Thanks Mayya!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org