benwtrent commented on code in PR #14080:
URL: https://github.com/apache/lucene/pull/14080#discussion_r1890670632
##########
lucene/core/src/java/org/apache/lucene/search/BooleanScorerSupplier.java:
##########
@@ -318,13 +318,26 @@ BulkScorer filteredOptionalBulkScorer() throws
IOException {
for (ScorerSupplier ss : subs.get(Occur.FILTER)) {
filters.add(ss.get(cost));
}
- Scorer filterScorer;
- if (filters.size() == 1) {
- filterScorer = filters.iterator().next();
+ if (scoreMode == ScoreMode.TOP_SCORES) {
Review Comment:
Ah, its possible now to have `scoreMode.needsScores() == false` now. I
suppose checking for `TOP_SCORES` or `scoreModel.needsScores()` is the same due
to the check on line 307. It just took me a bit to connect the two.
##########
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:
I don't understand the switch to allow `minShouldMatch == 0`. I would have
thought this meant they aren't applied at all in the skipping logic?
--
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]