romseygeek commented on code in PR #15727:
URL: https://github.com/apache/lucene/pull/15727#discussion_r2833756733


##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentDocValues.java:
##########
@@ -205,22 +253,28 @@ public int nextDoc() throws IOException {
       return docID;
     }
 
-    assert parents.get(childWithValues.docID()) == false;
+    seen = false;
+    while (seen == false) {
+      assert parents.get(childWithValues.docID()) == false;
 
-    int nextParentDocID = parents.nextSetBit(childWithValues.docID());
-    collector.reset();
-    seen = true;
+      int nextParentDocID = parents.nextSetBit(childWithValues.docID());

Review Comment:
   Worth adding a test that exercises this scenario.



##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentDocValues.java:
##########
@@ -205,22 +253,28 @@ public int nextDoc() throws IOException {
       return docID;
     }
 
-    assert parents.get(childWithValues.docID()) == false;
+    seen = false;
+    while (seen == false) {
+      assert parents.get(childWithValues.docID()) == false;
 
-    int nextParentDocID = parents.nextSetBit(childWithValues.docID());
-    collector.reset();
-    seen = true;
+      int nextParentDocID = parents.nextSetBit(childWithValues.docID());

Review Comment:
   I think we need to check for `NO_MORE_DOCS` here now, given that it's 
possible that we iterate through parent docs until there are none left?



-- 
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