lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: Reuse TermDocs
Date Mon, 05 Nov 2007 14:29:36 GMT
On 11/5/07, Mike Streeton <mike.streeton@ardentiasearch.com> wrote:
> Can TermDocs be reused i.e. can you do.
>
> TermDocs docs = reader.termDocs();
> docs.seek(term1);
> int i = 0;
> while (docs.next()) {
>         i++;
> }
> docs.seek(term2);
> int j = 0;
> while (docs.next()) {
>         j++;
> }
>
> Reuse does seem to work but I get ArrayIndexOutOfBoundsExceptions from BitVector it I
reuse the same one over a period of time.

That shouldn't happen... your reuse looks fine.
TermDocs instances are not thread safe - I assume you are only reusing
it from a single thread?
Is it possible for you to create a test case that reproduces this?

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message