Mikep86 commented on code in PR #13764:
URL: https://github.com/apache/lucene/pull/13764#discussion_r1754980924
##########
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:
The default `bulkScorer` implementation checks that
`scorerSupplier(context)` is non-null and calls
`scorerSupplier.setTopLevelScoringClause()`, so I think we need to do that as
well here too.
--
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]