This is true of Lucene today, with one exception: if an add/updateDocument call hits an exception it's possible it consumed a docID (which is immediately marked as deleted). This will cause your index to have deletions.
I don't think this behavior is guaranteed in future releases of Lucene. Mike Gunjan Juyal <[EMAIL PROTECTED]> wrote: > > Hi. > I am creating an index where there are no deletions, just additions. After > the index creation is done I need to create another mapping of doc-ids to > some data. > If there are only additions and no deletions then can we assume that the > doc-ids will be in the same order in which the documents were added, with > the doc-ids being incremented by 1 each time? If so then I don't need to > query lucene again as I already know the initial max doc-id and the order in > which I added the docs. More specifically:- > - If I add 'N' documents to the index in some order, can I expect that the > doc-ids will also be in the same order with each doc-id differing from the > previous by 1? > - If this is the case, then can we expect the future versions of lucene to > behave in the same way or is it undefined? > Thanks! > -- > View this message in context: > http://www.nabble.com/Do-doc-ids-always-increment-by-1-if-no-deletion-is-done--tp18983180p18983180.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]