Issue Details (XML | Word | Printable)

Key: LUCENE-1194
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Michael McCandless
Reporter: Michael McCandless
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Add deleteByQuery to IndexWriter

Created: 26/Feb/08 03:54 PM   Updated: 11/Oct/08 12:49 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1194.patch 2008-02-26 03:55 PM Michael McCandless 56 kB
Text File Licensed for inclusion in ASF works LUCENE-1194.take2.patch 2008-03-01 05:29 PM Michael McCandless 73 kB

Lucene Fields: New
Resolution Date: 06/Mar/08 11:02 AM


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael McCandless made changes - 26/Feb/08 03:55 PM
Field Original Value New Value
Attachment LUCENE-1194.patch [ 12376495 ]
Michael McCandless made changes - 01/Mar/08 05:29 PM
Attachment LUCENE-1194.take2.patch [ 12376906 ]
Michael McCandless made changes - 06/Mar/08 11:02 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Michael McCandless made changes - 11/Oct/08 12:49 PM
Status Resolved [ 5 ] Closed [ 6 ]