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

[jira] [Comment Edited] (LUCENE-5495) Boolean Filter does not handle FilterClauses with only bits() implemented

    [ https://issues.apache.org/jira/browse/LUCENE-5495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13922940#comment-13922940 ] 

Lei Wang edited comment on LUCENE-5495 at 3/6/14 7:35 PM:
----------------------------------------------------------

 {noformat}
+  public BitsDocIdSet(Bits bits, int length) {
+    this.bits = bits;
+    this.length = length;
+  }
 {noformat}

We can assert bits is not a DocIdSet here. if it is, this adds overhead only.

 {noformat}
+    final List<Bits> mustBitsList = new ArrayList<Bits>();
+    final List<Bits> mustNotBitsList = new ArrayList<Bits>();
 {noformat}

May need a SHOULD list also?

 {noformat}
+        if (bits != null) {
+          mustNotBitsList.add(bits);
+        }
 {noformat}

if bits is already a FixedBitSet or OpenBitSet, merge them into res might be faster? same for other lists




was (Author: wonlay):
+  public BitsDocIdSet(Bits bits, int length) {
+    this.bits = bits;
+    this.length = length;
+  }

We can assert bits is not a DocIdSet here. if it is, this adds overhead only.


+    final List<Bits> mustBitsList = new ArrayList<Bits>();
+    final List<Bits> mustNotBitsList = new ArrayList<Bits>();

May need a SHOULD list also?


+        if (bits != null) {
+          mustNotBitsList.add(bits);
+        }

if bits is already a FixedBitSet or OpenBitSet, merge them into res might be faster? same for other lists



> Boolean Filter does not handle FilterClauses with only bits() implemented
> -------------------------------------------------------------------------
>
>                 Key: LUCENE-5495
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5495
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/search
>    Affects Versions: 4.6.1
>            Reporter: John Wang
>         Attachments: LUCENE-5495.patch
>
>
> Some Filter implementations produce DocIdSets without the iterator() implementation, such as o.a.l.facet.range.Range.getFilter().
> Currently, such filters cannot be added to a BooleanFilter because BooleanFilter expects all FilterClauses with Filters that have iterator() implemented.
> This patch improves the behavior by taking Filters with bits() implemented and treat them separately.
> This behavior would be faster in the case for Filters with a forward index as the underlying data structure, where there would be no need to scan the index to build an iterator.
> 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