lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Smith <sheb...@gmail.com>
Subject Re: What on earth is FilteredQuery.explain doing?
Date Tue, 14 Jul 2015 18:50:14 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message