LUCENE-7486: Explain() should initialize maxScore to NEGATIVE_INFINITY too.

This commit is contained in:
Adrien Grand 2016-10-14 15:18:29 +02:00
parent ea1212232d
commit 9304ef9f11
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ public final class DisjunctionMaxQuery extends Query implements Iterable<Query>
@Override @Override
public Explanation explain(LeafReaderContext context, int doc) throws IOException { public Explanation explain(LeafReaderContext context, int doc) throws IOException {
boolean match = false; boolean match = false;
float max = 0.0f, sum = 0.0f; float max = Float.NEGATIVE_INFINITY, sum = 0.0f;
List<Explanation> subs = new ArrayList<>(); List<Explanation> subs = new ArrayList<>();
for (Weight wt : weights) { for (Weight wt : weights) {
Explanation e = wt.explain(context, doc); Explanation e = wt.explain(context, doc);