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 <http://issues.apache.org/jira/browse/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: <http://issues.apache.org/jira/browse/LUCENE-565?focusedCommentId=12459506#action_12459506>). Several of Lucene's test cases invoke updateDocument(), e.g. o.a.l.index.TestIndexWriterDelete.testOperationsOnDiskFull(): <http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_0/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?view=markup> > 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). Steve --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org