mirror of https://github.com/apache/lucene.git
LUCENE-2635: fix BQ to not provide matching explanation if a required sub-clause has null scorer
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@994976 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5d74641c6c
commit
f4d567eb06
|
@ -240,6 +240,11 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
|
|||
Weight w = wIter.next();
|
||||
BooleanClause c = cIter.next();
|
||||
if (w.scorer(reader, true, true) == null) {
|
||||
if (c.isRequired()) {
|
||||
fail = true;
|
||||
Explanation r = new Explanation(0.0f, "no match on required clause (" + c.getQuery().toString() + ")");
|
||||
sumExpl.addDetail(r);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Explanation e = w.explain(reader, doc);
|
||||
|
|
Loading…
Reference in New Issue