You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2016/10/14 13:30:21 UTC
[2/2] lucene-solr:branch_6x: LUCENE-7486: Explain() should initialize
maxScore to NEGATIVE_INFINITY too.
LUCENE-7486: Explain() should initialize maxScore to NEGATIVE_INFINITY too.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b5a98cc5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b5a98cc5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b5a98cc5
Branch: refs/heads/branch_6x
Commit: b5a98cc52c29dbcb79299396d44db6b604c2c422
Parents: 96e0c2f
Author: Adrien Grand <jp...@gmail.com>
Authored: Fri Oct 14 15:18:29 2016 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Fri Oct 14 15:29:57 2016 +0200
----------------------------------------------------------------------
.../src/java/org/apache/lucene/search/DisjunctionMaxQuery.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b5a98cc5/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
index 8b1c45d..fe85c72 100644
--- a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
@@ -162,7 +162,7 @@ public final class DisjunctionMaxQuery extends Query implements Iterable<Query>
@Override
public Explanation explain(LeafReaderContext context, int doc) throws IOException {
boolean match = false;
- float max = 0.0f, sum = 0.0f;
+ float max = Float.NEGATIVE_INFINITY, sum = 0.0f;
List<Explanation> subs = new ArrayList<>();
for (Weight wt : weights) {
Explanation e = wt.explain(context, doc);