lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: document numbers
Date Wed, 11 Jun 2003 16:40:50 GMT
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 <maurice.coyle@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


Mime
View raw message