jpountz commented on code in PR #13764:
URL: https://github.com/apache/lucene/pull/13764#discussion_r1755463353


##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java:
##########
@@ -180,6 +186,26 @@ public void setTopLevelScoringClause() throws IOException {
       };
     }
 
+    @Override
+    public BulkScorer bulkScorer(LeafReaderContext context) throws IOException 
{
+      if (scoreMode == ScoreMode.None) {
+        // BlockJoinBulkScorer evaluates all child hits exhaustively, but when 
scoreMode is None
+        // we only need to evaluate a single child doc per parent. In this 
case, use the default
+        // bulk scorer instead, which uses BlockJoinScorer to iterate over 
child hits.
+        // BlockJoinScorer is optimized to skip child hit evaluation when 
scoreMode is None.
+        return super.bulkScorer(context);
+      }
+
+      ScorerSupplier scorerSupplier = scorerSupplier(context);
+      if (scorerSupplier == null) {
+        // No docs match
+        return null;
+      }
+      scorerSupplier.setTopLevelScoringClause();

Review Comment:
   I don't think we need to. However, we should check the return value of 
`in.bulkScorer` for null.



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