[ https://issues.apache.org/jira/browse/LUCENE-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13924432#comment-13924432 ]
Lei Wang commented on LUCENE-5488: ---------------------------------- {noformat} + if (result == null) { + result = new Explanation + (0.0f, "failure to match filter: " + f.toString()); {noformat} if inner == null, result will be null here, we should not rewrite it to "failure to ...", should continue return null > FilteredQuery.explain does not honor FilterStrategy > --------------------------------------------------- > > Key: LUCENE-5488 > URL: https://issues.apache.org/jira/browse/LUCENE-5488 > Project: Lucene - Core > Issue Type: Bug > Components: core/search > Affects Versions: 4.6.1 > Reporter: John Wang > Assignee: Michael Busch > Attachments: LUCENE-5488.patch, LUCENE-5488.patch > > > Some Filter implementations produce DocIdSets without the iterator() > implementation, such as o.a.l.facet.range.Range.getFilter(). It is done with > the intention to be used in conjunction with FilteredQuery with > FilterStrategy set to be QUERY_FIRST_FILTER_STRATEGY for performance reasons. > However, this behavior is not honored by FilteredQuery.explain where > docidset.iterator is called regardless and causing such valid usages of above > filter types to fail. > The fix is to check bits() first and and fall back to iterator if bits is > null. In which case, the input Filter is indeed bad. > See attached unit test, which fails without this patch. -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org