johannes
unread,Sep 23, 2011, 7:32:32 AM9/23/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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