lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [2/2] lucene-solr:branch_6x: LUCENE-7352: Fix CheckHits for DisjunctionMax queries that generate negative scores.
Date Thu, 23 Jun 2016 17:05:14 GMT
LUCENE-7352: Fix CheckHits for DisjunctionMax queries that generate negative scores.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c5defadd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c5defadd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c5defadd

Branch: refs/heads/branch_6x
Commit: c5defadd70a9f91bc31012b7c31c39f16d883849
Parents: 388d388
Author: Adrien Grand <jpountz@gmail.com>
Authored: Thu Jun 23 19:03:39 2016 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Thu Jun 23 19:04:50 2016 +0200

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/search/CheckHits.java           | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c5defadd/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java
index f129605..9a14b5d 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java
@@ -354,8 +354,12 @@ public class CheckHits {
       if (detail.length==1) {
         // simple containment, unless it's a freq of: (which lets a query explain how the
freq is calculated), 
         // just verify contained expl has same score
-        if (!expl.getDescription().endsWith("with freq of:"))
+        if (expl.getDescription().endsWith("with freq of:") == false
+            // with dismax, even if there is a single sub explanation, its
+            // score might be different if the score is negative
+            && (score >= 0 || expl.getDescription().endsWith("times others of:")
== false)) {
           verifyExplanation(q,doc,score,deep,detail[0]);
+        }
       } else {
         // explanation must either:
         // - end with one of: "product of:", "sum of:", "max of:", or


Mime
View raw message