Bug in ImmutableIntArrayDocIdSet?

37 views
Skip to first unread message

johannes

unread,
Sep 23, 2011, 7:32:32 AM9/23/11
to kamikaze
Hi,

first of all thanks for the great work.It's really to cool to have
DocSet classes that focus on sorted int sets. There's a primitive
version of it in solr, but if you want to build something for lucene
only the only thing I could find was the SortedVIntList in lucene.

I used ImmutableIntArrayDocIdSet and it worked perfectly fine until I
encounterend a query which visits docId 0 (it was a negative query
combined with a MatchAllDocsQuery).

I get an ArrayIndexOutOfBoundsException when issuing that query. It
seems that the problem is rooted in the advance() method, when the dsi
is advanced to doc 0. The folling code shows the problem:


public class TestIntArrayIdDocSet {

@Test
public void test() throws IOException{

int[] data = new int[]{20,30,40};

ImmutableIntArrayDocIdSet dsImmutable = new
ImmutableIntArrayDocIdSet(data);
IntArrayDocIdSet dsRegular = new IntArrayDocIdSet();

dsRegular.addDocs(data, 0, data.length);
DocIdSetIterator dsImmutableIt = dsImmutable.iterator();
DocIdSetIterator dsRegualIt = dsRegular.iterator();

dsRegualIt.advance(0); // works
dsImmutableIt.advance(0); // throws exception


}
}

The mutable version of the DocSet handles this advance just fine.

Thanks for your attention and keep up with the great work,

Johannes

John Wang

unread,
Sep 23, 2011, 11:43:30 AM9/23/11
to kamikaz...@googlegroups.com
Thanks Johannes!

I have created the bug in our jira for tracking:

http://linkedin.jira.com/browse/KAMI-25  (In the future, please feel free to create bugs there)

I have added your test to our unit test and indeed it shows failure.

We will be working on the fix.

Thanks

-John


--
You received this message because you are subscribed to the Google Groups "kamikaze" group.
To post to this group, send email to kamikaz...@googlegroups.com.
To unsubscribe from this group, send email to kamikaze-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/kamikaze-users?hl=en.


Reply all
Reply to author
Forward
0 new messages