Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-1194

Add deleteByQuery to IndexWriter

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4
    • None
    • None
    • New

    Description

      This has been discussed several times recently:

      http://markmail.org/message/awlt4lmk3533epbe
      http://www.gossamer-threads.com/lists/lucene/java-user/57384#57384

      If we add deleteByQuery to IndexWriter then this is a big step towards
      allowing IndexReader to be readonly.

      I took the approach suggested in that first thread: I buffer delete
      queries just like we now buffer delete terms, holding the max docID
      that the delete should apply to.

      Then, I also decoupled flushing deletes (mapping term or query -->
      actual docIDs that need deleting) from flushing added documents, and
      now I flush deletes only when a merge is started, or on commit() or
      close(). SegmentMerger now exports the docID map it used when
      merging, and I use that to renumber the max docIDs of all pending
      deletes.

      Finally, I turned off tracking of memory usage of pending deletes
      since they now live beyond each flush. Deletes are now only
      explicitly flushed if you set maxBufferedDeleteTerms to something
      other than DISABLE_AUTO_FLUSH. Otherwise they are flushed at the
      start of every merge.

      Attachments

        1. LUCENE-1194.take2.patch
          73 kB
          Michael McCandless
        2. LUCENE-1194.patch
          56 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: