mirror of https://github.com/apache/lucene.git
Fix test failure.
This commit is contained in:
parent
483d28853a
commit
ce464c7d6d
|
@ -40,8 +40,9 @@ final class BlockMaxConjunctionBulkScorer extends BulkScorer {
|
|||
private final DocIdSetIterator lead;
|
||||
private final DocAndScore scorable = new DocAndScore();
|
||||
private final double[] sumOfOtherClauses;
|
||||
private final int maxDoc;
|
||||
|
||||
BlockMaxConjunctionBulkScorer(List<Scorer> scorers) throws IOException {
|
||||
BlockMaxConjunctionBulkScorer(int maxDoc, List<Scorer> scorers) throws IOException {
|
||||
if (scorers.size() <= 1) {
|
||||
throw new IllegalArgumentException("Expected 2 or more scorers, got " + scorers.size());
|
||||
}
|
||||
|
@ -51,6 +52,7 @@ final class BlockMaxConjunctionBulkScorer extends BulkScorer {
|
|||
Arrays.stream(this.scorers).map(Scorer::iterator).toArray(DocIdSetIterator[]::new);
|
||||
lead = iterators[0];
|
||||
this.sumOfOtherClauses = new double[this.scorers.length];
|
||||
this.maxDoc = maxDoc;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +81,7 @@ final class BlockMaxConjunctionBulkScorer extends BulkScorer {
|
|||
windowMin = Math.max(lead.docID(), windowMax + 1);
|
||||
}
|
||||
|
||||
return windowMin;
|
||||
return windowMin >= maxDoc ? DocIdSetIterator.NO_MORE_DOCS : windowMin;
|
||||
}
|
||||
|
||||
private void scoreWindow(
|
||||
|
|
|
@ -315,7 +315,7 @@ final class BooleanWeight extends Weight {
|
|||
&& requiredScoring.size() > 1
|
||||
// Only specialize top-level conjunctions for clauses that don't have a two-phase iterator.
|
||||
&& requiredScoring.stream().map(Scorer::twoPhaseIterator).allMatch(Objects::isNull)) {
|
||||
return new BlockMaxConjunctionBulkScorer(requiredScoring);
|
||||
return new BlockMaxConjunctionBulkScorer(context.reader().maxDoc(), requiredScoring);
|
||||
}
|
||||
if (scoreMode == ScoreMode.TOP_SCORES && requiredScoring.size() > 1) {
|
||||
requiredScoring =
|
||||
|
|
Loading…
Reference in New Issue