lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven A Rowe <>
Subject RE: What are the best document edit options?
Date Wed, 17 Dec 2008 20:39:02 GMT
Hi Thomas,

On 12/17/2008 at 11:52 AM, Thomas J. Buhr wrote:
> Where can I see how IndexWriter.updateDocument works without getting
> into Lucene all over again until this important issue is resolved?
> Is there a sample of its usage for updating specific fields in a
> given document?

The updateDocument() functionality was added to IndexWriter in Lucene v2.1.0 under the aegis
of LUCENE-565 <>, and the discussion
there should help, especially the design overviews (more than one there - look for Ning Li's
2006-12-18 comment: <>).

Several of Lucene's test cases invoke updateDocument(), e.g. o.a.l.index.TestIndexWriterDelete.testOperationsOnDiskFull():


> Is the update immediate or delayed?

My reading of the way this all works is that IndexWriter buffers deletes and only writes them
out to disk on flush, which can be triggered by a commit.  An IndexReader over this index
will only see a single post-commit snapshot.  So there will be a delay: the IndexWriter must
perform a commit, and the IndexReader must be closed and then opened again (or just reopen()'d,
as of Lucene v2.3.0).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message