On Jan 16, 2008 2:13 PM, Alexei Dets <[EMAIL PROTECTED]> wrote: > Hi! > Yonik Seeley wrote: > > On Jan 15, 2008 7:15 PM, Alexei Dets <[EMAIL PROTECTED]> wrote: > >> I'm curious, is there any particular reason why Lucene offers > >> IndexReader.deleteDocument(int docNum) but not > >> IndexWriter.deleteDocument(int docNum)? > > > > Document ids are transient and can change. > > I was under impression that document id can change _only_ after index merges > and optimizations, that id of the document definitely doesn't change if > index is not modified and doesn't change even after deletions or additions > of the new documents.
An addition of a document can trigger segment merges. > Otherwise IndexReader.deleteDocument(int docNum) will > make no sense as well - all ids returned by the search will be invalidated > after first deleteDocument call? IndexReader.deleteDocument grabs the write lock and is hence mutually exclusive with an open IndexWriter. -Yonik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]