On Tue, 16 Jan 2007, Doug Cutting wrote:
Michael McCandless wrote:
We could indeed simply tie "close" to mean "commit now", and not add a
separate "commit" method.
But what about the "bulk delete then bulk add" case? Ideally if a
reader refreshes by checking "isCurrent()" it shouldn't ever open the
index "at a bad time". Ie, we need a way to open a reader, delete a
bunch of docs, close it *without* committing, open a writer, add a
bunch of docs, and then do the commit, all so that any readers that
are refreshing would know not to open the segments_N that was
committed with all the deletes but none of the adds. This is one use
case that explicit commits would address.
One could also implement this with a Directory that permits checkpointing and
rollback. Would that be any simpler?
The Berkeley DB Directory implementation supports ACID transactions, rollback,
checkpointing, and all this good db stuff. Having an API for explicitely
committing a Lucene index would make it easier to use Berkeley DB transactions
with DbDirectory. Currently, because there is no notion of a transaction
inside the Lucene core, the entire transaction logic used along with
DbDirectory has to be external and it wraps operations that are too coarse
or too expensive such as opening and closing readers and writers.
Having an API that explicitely tells the underlying Directory to commit or
rollback whatever it was doing would be excellent. On the other hand,
implementing support for this at a higher level than the Directory framework
would essentially duplicate what a database-based Directory implementation
already has access to through the underlying database. As with the Lock class,
it would be great to have it easy to implement a no-op version of this Lucene
transaction support that defers to the underlying database for the actual
transaction work.
Numerous threads in the past here have ended with 'a Lucene index is not a
database'....
Andi..
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]