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 <[email protected]> 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: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
