benwtrent commented on code in PR #15380:
URL: https://github.com/apache/lucene/pull/15380#discussion_r2474369306


##########
lucene/core/src/java/org/apache/lucene/search/DisjunctionScorer.java:
##########
@@ -101,9 +101,20 @@ DisiWrapper getSubMatches() throws IOException {
         }
       }
       unverifiedMatches.clear();
+      assert assertVerifiedMatchesApproximationDocID();
       return verifiedMatches;
     }
 
+    private boolean assertVerifiedMatchesApproximationDocID() {
+      int docID = docID();
+      for (DisiWrapper w = verifiedMatches; w != null; w = w.next) {
+        if (w.approximation.docID() != docID) {
+          return false;
+        }
+      }
+      return true;
+    }

Review Comment:
   This SEEMS like correct behavior right? If we have a verified match, all 
their approximations should be on the current docID?
   
   Or do I misunderstand what "approximation" means? Maybe we need to assert 
against `w.doc`? However, even then, I would expect `w.doc == w.approximation` 
once things are all verified right?
   
   @jpountz has basically rewritten this entire class over its life time LOL. I 
am not sure if he is available for feedback here. 
   
   Maybe @romseygeek ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to