You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "John Wang (JIRA)" <ji...@apache.org> on 2014/03/05 05:57:42 UTC

[jira] [Created] (LUCENE-5488) FilteredQuery.explain does not honor FilterStrategy

John Wang created LUCENE-5488:
---------------------------------

             Summary: 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


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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org