lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Réf. : Re: IndexSearcher and number of occurence
Date Thu, 13 Jan 2005 15:36:49 GMT

On Jan 13, 2005, at 10:17 AM, Bertrand VENZAL wrote:

> Hi,
> Thanks for your quick answer, I understood wot u meant by using the
> indexSearcher to get the termFreqVector. But, you use an int as an id 
> to
> find the termFrequency so I suppose that it is the position number in 
> the
> IndexReader vector.
> My problem is : during the indexing phase, I can store the id, but if a
> document is deleted and recreated later on (like in an update), this 
> will
> change my vector and all the id's previously set will be no more 
> correct.
> Am i right on this point ? or am i missing something ...

Yes, the Document id (the one Lucene uses) is not to be relied on 
long-term.  But, in the example you'd get it from Hits immediately 
after a search, and thus it would be accurate and usable.  You do not 
need to store any the id during indexing - Lucene maintains it and 
gives it to you from Hits.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message