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


##########
lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java:
##########
@@ -250,31 +254,108 @@ BulkScorer optionalBulkScorer(LeafReaderContext context) 
throws IOException {
         this, optional, Math.max(1, query.getMinimumNumberShouldMatch()), 
scoreMode.needsScores());
   }
 
-  // Return a BulkScorer for the required clauses only,
-  // or null if it is not applicable
+  // Return a BulkScorer for the required clauses only
   private BulkScorer requiredBulkScorer(LeafReaderContext context) throws 
IOException {
-    BulkScorer scorer = null;
+    // Is there a single required clause by any chance? Then pull its bulk 
scorer.
+    Optional<WeightedBooleanClause> singleRequiredClause = null;

Review Comment:
   Good call, it would be much simpler this way.



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