lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrzej Bialecki>
Subject Re: Document Order in IndexWriter.addIndexes
Date Wed, 30 Jun 2010 06:24:26 GMT
On 2010-06-30 05:12, Apoorv Sharma wrote:
> while calling addindexes or addindexes with no optimize can any gurantee be
> given about the document order in the new documents given that the order of
> directories/indexreader is fixed.
> So is it that ith document coming from jth indexreader will always have some
> x(i,j) position in the final merged index ?

Currently that should be the case. SegmentMerger copies contiguous
ranges of documents from readers (removing deletions), in the same order
as they were provided to addIndexes. Document numbers are shifted to
account for deletions, but other than that they are sequentially
increased according to each sub-reader's docBase+docNum.

HOWEVER... this is an implementation detail, not any API guarantee, and
while it works today it may change silently in a minor Lucene revision.
Design your application so that it doesn't rely on this behavior. You
have been warned :)

Best regards,
Andrzej Bialecki     <><
 ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration  Contact: info at sigram dot com

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

View raw message