On 8/8/07, Ning Li <[EMAIL PROTECTED]> wrote: > On 8/8/07, Yonik Seeley <[EMAIL PROTECTED]> wrote: > > On 8/8/07, Ning Li <[EMAIL PROTECTED]> wrote: > > > But you still think it's worth to be included in IndexWriter, right? > > > > I'm not sure... (unless I'm missing some obvious use-cases). > > If one could get a list of IndexReaders, one could directly use those > > for deletions, right? > > This is so that users won't have to close IndexWriter to do such > deletes, flush deletes and re-open IndexWriter to continue adding > documents.
Let's take a simple case of deleting documents in a range, like date:[2006 TO 2008] One would currently need to close the writer and open a new reader to ensure that they can "see" all the documents. Then execute a RangeQuery, collect the ids, and do deletes. If one wanted to use IndexWriter.deleteDocument(int doc) instead, then one would still need to ensure that all documents were first flushed, and would further need to ensure that no docids changed from when the reader was opened (basically, that no adds/optimizes had been done via the writer). So it seems that we are back to square one (closing the writer, opening a new reader, etc). Something that allowed one to request a list of readers (perhaps just at a special point after a flush or before a merge) would get around these issues I think. -Yonik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]