You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2016/10/15 23:55:29 UTC

[17/24] lucene-solr:jira/solr-8396: 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/9304ef9f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9304ef9f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9304ef9f

Branch: refs/heads/jira/solr-8396
Commit: 9304ef9f118d24f76b280299706310ca8a0d40e6
Parents: ea12122
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:30 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/9304ef9f/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 b29126b..44cbd52 100644
--- a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
@@ -141,7 +141,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);