Mikep86 commented on code in PR #13587:
URL: https://github.com/apache/lucene/pull/13587#discussion_r1684517801


##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java:
##########
@@ -101,12 +101,16 @@ public Weight createWeight(
               .rewrite(new ConstantScoreQuery(childQuery))
               .createWeight(searcher, weightScoreMode, 0f);
     } else {
-      // if the score is needed we force the collection mode to COMPLETE 
because the child query
-      // cannot skip
-      // non-competitive documents.
+      // if the score is needed and the score mode is not max, we force the 
collection mode to
+      // COMPLETE because the
+      // child query cannot skip non-competitive documents.
       childWeight =
           childQuery.createWeight(
-              searcher, weightScoreMode.needsScores() ? COMPLETE : 
weightScoreMode, boost);
+              searcher,
+              weightScoreMode.needsScores() && childScoreMode != ScoreMode.Max

Review Comment:
   Technically we don't need to check if `weightScoreMode.needsScores()` is 
true here, it always will be if we get to this point. I left it because it 
makes the logic clearer, LMKWYT!



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