lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lu <>
Subject Re: Will doc ids ever change if nothing is deleted?
Date Fri, 14 May 2010 18:04:36 GMT
The doc id will get changed if the segments are merged. The doc id is 
more depending on the order of documents being added.

Just think about it. The doc ids are starting from 0 to N. And when some 
documents are deleted, they are marked deleted on .del file. So no 
change there. When some documents are added, the id is N+1.

Of course, if some documents from other segments are merged. The 
documents in one segment will "lose" its doc id.

Chris Lu
Instant Scalable Full-Text Search On Any Database/Application
Lucene Database Search in 3 minutes:
DBSight customer, a shopping comparison site, (anonymous per request) 
got 2.6 Million Euro funding!

On 05/13/2010 06:38 PM, Nigel wrote:
> The FAQ clearly states that document IDs will not be re-assigned unless
> something was deleted.
> However, a number of other emails and posts I've read mention that
> renumbering occurs when segments are merged.  Maybe what people mean
> is simply that when something is deleted, nothing is immediately renumbered,
> and it's not until merge time that the renumbering happens.  (This is my
> understanding of how it works.)
> Just so I'm 100% clear, if I never delete anything, will the IDs ever
> change?
> Thanks,
> Chris

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

View raw message