Skip to content

Commit

Permalink
Make DenseConjunctionBulkScorer set a Scorer.
Browse files Browse the repository at this point in the history
This is important because some composite scorers collect the same
segment with different scorers. So if a `BulkScorer` doesn't set a
`Scorer`, the collector may implicitly use the scorer that was used to
collect a previous window of doc IDs.

Closes #14088.
  • Loading branch information
jpountz committed Dec 29, 2024
1 parent c0fc700 commit 525b963
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
return lead.docID();
}

// This scorer is only used for conjunctions of FILTER clauses, so we set a simple scorer that
// always returns a score of zero.
collector.setScorer(new SimpleScorable());
List<DocIdSetIterator> otherIterators = this.others;
DocIdSetIterator collectorIterator = collector.competitiveIterator();
if (collectorIterator != null) {
Expand Down

0 comments on commit 525b963

Please sign in to comment.