lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: IndexWriter#updateDocument(Term, Document)
Date Wed, 18 Jun 2014 14:20:04 GMT
Your first case is supposed to work; if it doesn't it's a bad bug :)

Can you reduce it to a small example?

Mike McCandless

http://blog.mikemccandless.com


On Wed, Jun 18, 2014 at 10:08 AM, Clemens Wyss DEV <clemensdev@mysign.ch> wrote:
> 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-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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


Mime
View raw message