lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <ysee...@gmail.com>
Subject Re: Rollback
Date Sat, 10 Jun 2006 00:55:46 GMT
On 6/9/06, Grant Ingersoll <grant_ingersoll@yahoo.com> wrote:
> I know about commit.  Is it possible to rollback?  Or is this just involve deleting and/or
readding the necessary documents
>  before committing?

It's not currently possible with DirectUpdateHander2, as documents are
added directly into the main index.

A long time ago, my first idea at how to do the update handler was to
index to a separate index (FS or RAM) and then merge it with the main
index on a commit.  Then I looked at the code for Lucene's
IndexWriter.addIndexes(), saw that it did an optimize() at the start
and end of the merge, and discounted using it.

An IndexWriter.addIndexes() that doesn't do optimize() is certainly
doable in Lucene.  If we had that, we could perhaps have an alternate
UpdateHander that drops the new inserts/deletes.  deleteByQuery still
presents problems though...

It could also be done in DirectUpdateHandler2 with more careful
tracking of what is added vs deleted, and if rollback is called, drop
the deletions, and delete the additions.

-Yonik

Mime
View raw message