I would like to perform a batch update on an index. In order to omit duplicate 
entries I am making use of IndexWriter#updateDocument(Term, Document)

open an IndexWriter;
foreach( element in elementsToBeUpdatedWhichHaveDuplicates )
{
doc = element.toDoc();
indexWriter.updateDocument( uniqueTermForElement, doc );
}

Unfortunately  this does not seem to work, whereas

open an IndexWriter;
foreach( element in elementsToBeUpdatedWhichHaveDuplicates )
{
doc = element.toDoc();
indexWriter.updateDocument( uniqueTermForElement, doc );
indexWriter.commit(); // expensive?
}

does. How can I batchupdate without commiting?

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to