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: Which is more efficient
Date Tue, 05 May 2009 12:16:25 GMT
They should be very nearly the same.  Under the hood, when you call
updateDocument, IndexWriter buffers up the deleted terms, and flushes
them periodically.

Mike

On Tue, May 5, 2009 at 7:42 AM, Antony Bowesman <adb@teamware.com> wrote:
> Just wondered which was more efficient under the hood
>
>  for (int i = 0; i < size; i++)
>     terms[i] = new Term("id", doc_key[i]);
>
> This
>
>  writer.deleteDocuments(terms);
>  for (int i = 0; i < size; i++)
>     writer.addDocument(doc[i]);
>
> Or this
>
>  for (int i = 0; i < size; i++)
>     writer.updateDocument(terms[i], doc[i]);
>
>
> ---------------------------------------------------------------------
> 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