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 Otis Gospodnetic <ot...@yahoo.com> on 2003/06/11 18:40:50 UTC

Re: document numbers

Moving this to lucene-user.

I believe so, yes.
However, doc IDs are not persistent.  They get reused.  So running this
same code sometime in the future may give you a different Document for
doc ID 45.

Otis

--- Maurice Coyle <ma...@ucd.ie> wrote:
> hi,
> 
> i wonder could someone tell me if document numbers in a lucene index
> are
> consistent?
> that is, if i have an IndexReader read and i have the following code:
> 
> Document doc = read.document(45);
> 
> and later on, i have the following:
> 
> Term term = new Term(...);
> 
> TermDocs termdocs = read.termDocs(term);
> while(termdocs.next())
> {
>     int docnum = termdocs.doc();
> 
>     if(docnum==45)System.out.println("found it!");
> }
> 
> when the above code prints out that it has found it, is it referring
> to the
> same document as in the first code snippet above?
> 
> sorry if this is unclear, if so just say the word and i'll elaborate.
> 
> thanks,
> maurice
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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