lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1194) Add deleteByQuery to IndexWriter
Date Sat, 01 Mar 2008 17:30:51 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-1194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael McCandless updated LUCENE-1194:
---------------------------------------

    Attachment: LUCENE-1194.take2.patch

OK I attached a new rev of the patch, fixing the issue Ning spotted
(thanks!).  Now if autoCommit=true we apply deletes with every flush.

Other changes in this rev:

  * I modified the TestAtomicUpdate unit test to fail (because of this
    issue), and with the new patch it now passes.

  * I added the unLock/isLocked methods into IndexWriter and deprecated
    the ones in IndexReader.

  * I fixed an issue with commit() whereby it could return without
    committing, if another thread (merge thread) was in the process of
    committing at the same time.

  * Using the same testPoint call from LUCENE-1198, I added more test
    points so that I could tweak thread scheduling by randomly calling
    Thread.yield().  I changed TestStressIndexing2 & TestAtomicUpdate
    to do this.

I plan to commit in a few days.

> Add deleteByQuery to IndexWriter
> --------------------------------
>
>                 Key: LUCENE-1194
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1194
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: LUCENE-1194.patch, LUCENE-1194.take2.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message