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 Erik Hatcher <er...@ehatchersolutions.com> on 2005/02/04 10:53:46 UTC

Re: Document numbers and ids

On Feb 4, 2005, at 9:49 AM, Simeon Koptelov wrote:
> The LiA says that I can use Sort.INDEXORDER when indexing order is 
> relevant
> and gives an example where documents' ids (got from Hits.id() ) are
> increasing from top to bottom of resultset. Are that ids the same 
> thing as
> document numbers?

Yes, id is the same as document number.

> If they are the same, how can it be that they are preserved during 
> indexing
> process? LiA says that documents are renumbered when merging segments.

By "renumbered", it means it squeezes out holes left by deletes.  The 
actual order does not change and thus does not affect a Sort.INDEXORDER 
sort.

Documents are stored in the index in the order that they were indexed - 
nothing changes this order.  Document id's are not permanent if deletes 
occur followed by an optimize.

	Erik


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