You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Dmitry Lizorkin <li...@ispras.ru> on 2009/06/19 17:35:15 UTC

getting all Lucene internal IDs

Hello!

What is the appropriate way to obtain Lucene internal IDs for _all_ the 
tuples stored in a Lucene index?

Thank you for your help
Dmitry


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


Re: getting all Lucene internal IDs

Posted by Michael McCandless <lu...@mikemccandless.com>.
You're welcome!

Mike

On Fri, Jun 19, 2009 at 1:49 PM, Dmitry Lizorkin<li...@ispras.ru> wrote:
>> Iterate over all ints from 0 .. IndexReader.maxDoc() (exclusive) and
>> call IndexReader.isDeleted?
>
> Excellent, works perfect for us!
>
> Michael, thank you very much for your help!
>
> Best regards,
>  Dmitry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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


Re: getting all Lucene internal IDs

Posted by Dmitry Lizorkin <li...@ispras.ru>.
> Iterate over all ints from 0 .. IndexReader.maxDoc() (exclusive) and
> call IndexReader.isDeleted?

Excellent, works perfect for us!

Michael, thank you very much for your help!

Best regards,
  Dmitry


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


Re: getting all Lucene internal IDs

Posted by Michael McCandless <lu...@mikemccandless.com>.
On Fri, Jun 19, 2009 at 12:43 PM, Dmitry Lizorkin<li...@ispras.ru> wrote:

> In the meantime, does there exist any workaround for the current version
> 2.4.1 we're using?

Iterate over all ints from 0 .. IndexReader.maxDoc() (exclusive) and
call IndexReader.isDeleted?

Open a read-only IndexReader if possible, so isDeleted won't be synchronized.

Mike

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


Re: getting all Lucene internal IDs

Posted by Dmitry Lizorkin <li...@ispras.ru>.
> Assuming your goal is to exclude deleted docs
Yes, precisely.

>  TermDocs td = IndexReader.termDocs(null);

That looks exactly what we need! We'll be looking forward to the release of 
v. 2.9.

In the meantime, does there exist any workaround for the current version 
2.4.1 we're using?

Thank you for your prompt reply
Dmitry


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


Re: getting all Lucene internal IDs

Posted by Michael McCandless <lu...@mikemccandless.com>.
Assuming your goal is to exclude deleted docs, in 2.9 (not yet
released) you can do this:

  TermDocs td = IndexReader.termDocs(null);

and then iterate through them.

Mike

2009/6/19 Dmitry Lizorkin <li...@ispras.ru>:
> Hello!
>
> What is the appropriate way to obtain Lucene internal IDs for _all_ the
> tuples stored in a Lucene index?
>
> Thank you for your help
> Dmitry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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