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/06/23 17:05:13 UTC
[1/2] lucene-solr:master: LUCENE-7352: Fix CheckHits for
DisjunctionMax queries that generate negative scores.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 388d388c9 -> c5defadd7
refs/heads/master ece9d85cb -> 1e4d51f40
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/1e4d51f4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1e4d51f4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1e4d51f4
Branch: refs/heads/master
Commit: 1e4d51f4085664ef073ecac18dd572b0a9a02757
Parents: ece9d85
Author: Adrien Grand <jp...@gmail.com>
Authored: Thu Jun 23 19:03:39 2016 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Thu Jun 23 19:03:39 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/1e4d51f4/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
[2/2] lucene-solr:branch_6x: LUCENE-7352: Fix CheckHits for
DisjunctionMax queries that generate negative scores.
Posted by jp...@apache.org.
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 <jp...@gmail.com>
Authored: Thu Jun 23 19:03:39 2016 +0200
Committer: Adrien Grand <jp...@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