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


##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentDocValues.java:
##########
@@ -218,9 +255,15 @@ public int nextDoc() throws IOException {
         break;
       }
       collector.increment();
+      childrenWithValuesCount++;
     }
 
     docID = nextParentDocID;
+    int prevParentDocID = parents.prevSetBit(docID - 1);
+    hasChildWithMissingValue = childrenWithValuesCount < 
getTotalChildrenCount(prevParentDocID);
+    if (hasChildWithMissingValue && missingWithChildWithoutValue) {
+      docID = nextDoc();

Review Comment:
   Yes, I used a loop with the `seen` flag in the condition. I changed the 
code, so `seen` is set to `true` only when we are certain that the parent doc 
id will be returned. 
   
   It used to be set as long as we found a child doc, so I added a dedicated 
local flag for that and that allowed us to use the `seen` flag in the new loop.



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