LUCENE-8142: Fix QueryUtils to only call getMaxScore when it is legal to do so.

This commit is contained in:
Adrien Grand 2018-05-02 17:41:26 +02:00
parent 82e7cb2322
commit 67c13bbe2e
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ public class AssertingScorer extends Scorer {
assert iterating() : state;
final float score = in.score();
assert !Float.isNaN(score) : "NaN score for in="+in;
assert score <= getMaxScore(DocIdSetIterator.NO_MORE_DOCS);
assert lastShallowTarget == -1 || score <= getMaxScore(docID());
assert Float.compare(score, 0f) >= 0 : score;
return score;
}