zacharymorn commented on code in PR #12194:
URL: https://github.com/apache/lucene/pull/12194#discussion_r1133315303


##########
lucene/core/src/java/org/apache/lucene/search/ReqExclScorer.java:
##########
@@ -142,15 +142,43 @@ public TwoPhaseIterator twoPhaseIterator() {
     final float matchCost =
         matchCost(reqApproximation, reqTwoPhaseIterator, exclApproximation, 
exclTwoPhaseIterator);
 
+    final DocIdSetIterator skippingReqApproximation =
+        new DocIdSetIterator() {
+          @Override
+          public int docID() {
+            return reqApproximation.docID();
+          }
+
+          @Override
+          public int nextDoc() throws IOException {
+            int exclNonMatchingDoc = 
exclApproximation.peekNextNonMatchingDocID();
+            if (exclApproximation.docID() < docID() && docID() < 
exclNonMatchingDoc) {
+              return reqApproximation.advance(exclNonMatchingDoc);
+            } else {
+              return reqApproximation.nextDoc();
+            }
+          }
+
+          @Override
+          public int advance(int target) throws IOException {
+            return reqApproximation.advance(target);

Review Comment:
   Updated.



-- 
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-unsubscr...@lucene.apache.org

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


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

Reply via email to