TX,
This looks like a bug that has already been fixed on branch_5x as part of
LUCENE-6601 <https://issues.apache.org/jira/browse/LUCENE-6601>. The bug is
in org.apache.search.Filter.createWeight:
public Explanation explain(LeafReaderContext context, int doc) throws
IOException {
final Scorer scorer = scorer(context, context
.reader().getLiveDocs());
final boolean match = (scorer != null && scorer.advance(doc) == doc
);
if (match) {
assert scorer.score() == 0f;
return Explanation.match(0f, "Match on id " + doc);
} else {
return Explanation.match(0f, "No match on id " + doc);
}
}
Here you can see it calls Explanation.match for the last return instead
of Explanation.noMatch.
I imagine this will make it to the next 5.x point release.
--Terry