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


##########
lucene/core/src/java/org/apache/lucene/search/BooleanScorerSupplier.java:
##########
@@ -304,9 +304,9 @@ BulkScorer optionalBulkScorer() throws IOException {
   BulkScorer filteredOptionalBulkScorer() throws IOException {
     if (subs.get(Occur.MUST).isEmpty() == false
         || subs.get(Occur.FILTER).isEmpty()
-        || scoreMode != ScoreMode.TOP_SCORES
+        || (scoreMode.needsScores() && scoreMode != ScoreMode.TOP_SCORES)
         || subs.get(Occur.SHOULD).size() <= 1
-        || minShouldMatch > 1) {
+        || minShouldMatch != 1) {

Review Comment:
   Sorry, it's unrelated to this PR. This method is only called when 
minShouldMatch >= 1, so `minShouldMatch > 1` and `minShouldMatch != 1` are 
equivalent, but I liked that `!= 1` is more defensive.



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