Hmmmm, why do you care? That is, what is it you're trying to do that makes this question necessary? There might be a better solution than trying to depend on doc IDs.
Because I don't think you can assume that, even if it is deterministic with the version you're using now that it would be in some other version, Lucene makes no promises here. All the advice I've ever seen says that if you want to keep track of documents, you assign and index your own ID. You can get the doc ID from your unique term quite efficiently if you need to. HTH Erick On Wed, Nov 4, 2009 at 9:23 AM, Britske <gbr...@gmail.com> wrote: > > Hi, > > say I have: > - Indexreader[] readers = {reader1, reader2, reader3} //containing all > different docs > - I know the internal docids of documents in reader1, reader2, reader3 > seperately > > Does doing IndexWriter.addIndexesNoOptimize(Indexreader[] readers) on these > readers give me a determinstic and calculable set of docids on the > documents > in the resulting documentWriter? > > i.e: from http://lucene.apache.org/java/2_4_1/fileformats.html: > "The numbers stored in each segment are unique only within the segment, and > must be converted before they can be used in a larger context. The standard > technique is to allocate each segment a range of values, based on the range > of numbers used in that segment. To convert a document number from a > segment > to an external value, the segment's base document number is added." > > Does assinging docids in addIndexesNoOptimize work like this? > in other words: > - docids of docs in reader1 stay the same in indexwriter > - docids of docs in reader2 are incremented by reader1.docs.size(); > - docids of docs in reader3 are incremented by reader1.docs.size() + > reader2.docs.size() > > Thanks, > Geert-Jan > -- > View this message in context: > http://old.nabble.com/addIndexesNoOptimize-on-shards---%3E-is-docid-deterministic-and-calculable--tp26197146p26197146.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >