mirror of https://github.com/apache/lucene.git
Fix max score computation in BlockMaxConjunctionBulkScorer. (#13397)
It sums up max scores in a float when it should sum them up in a double like we do for `Scorer#score()`. Otherwise, max scores may be returned that are less than actual scores. This bug was introduced in #13343, so it is not released yet. Closes #13371 Closes #13396
This commit is contained in:
parent
da6bd22fd9
commit
5b1a34bddd
|
@ -67,7 +67,7 @@ final class BlockMaxConjunctionBulkScorer extends BulkScorer {
|
|||
scorers[i].advanceShallow(windowMin);
|
||||
}
|
||||
|
||||
float maxWindowScore = 0;
|
||||
double maxWindowScore = 0;
|
||||
for (int i = 0; i < scorers.length; ++i) {
|
||||
float maxClauseScore = scorers[i].getMaxScore(windowMax);
|
||||
sumOfOtherClauses[i] = maxClauseScore;
|
||||
|
@ -76,7 +76,7 @@ final class BlockMaxConjunctionBulkScorer extends BulkScorer {
|
|||
for (int i = sumOfOtherClauses.length - 2; i >= 0; --i) {
|
||||
sumOfOtherClauses[i] += sumOfOtherClauses[i + 1];
|
||||
}
|
||||
return maxWindowScore;
|
||||
return (float) maxWindowScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue