mirror of https://github.com/apache/lucene.git
LUCENE-7352: Fix CheckHits for DisjunctionMax queries that generate negative scores.
This commit is contained in:
parent
ece9d85cbe
commit
1e4d51f408
|
@ -354,8 +354,12 @@ public class CheckHits {
|
||||||
if (detail.length==1) {
|
if (detail.length==1) {
|
||||||
// simple containment, unless it's a freq of: (which lets a query explain how the freq is calculated),
|
// 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
|
// 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]);
|
verifyExplanation(q,doc,score,deep,detail[0]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// explanation must either:
|
// explanation must either:
|
||||||
// - end with one of: "product of:", "sum of:", "max of:", or
|
// - end with one of: "product of:", "sum of:", "max of:", or
|
||||||
|
|
Loading…
Reference in New Issue