lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Scerri <>
Subject Updating indexes incrementaly including replacnig old documents
Date Wed, 08 Dec 2004 13:59:02 GMT

I am looking into how best to support updating of indexes incrementaly
with support for replacing old documents. As I see it from what I have
read and tried. There are two ways of attempting this.

Option A
1)Open only a reader or search. From a list of documents to be
updated, find all those already indexed, using an IndexReader (or
Searcher), and get the document IDs.
2)For each ID delete it using an IndexReader.
3)Then close the reader, then open a writer, and index all the new documents.
4)Close the writer, and reopen all readers and searchers where necessary.

Option B
1)Open only a writer and index all the documents, keeping track of any
occurenct of an existing document.
2)Close the writer, and open a reader. Delete all updated documents.
Continue to use the reader or searchers, reopenning to flush to disk
if necessary.

Would these be the two appropriate solutions, or are their better ways
to do it (without creating a second index and then switching between
them). In particular can you avoid either having duplicate records
from option A, or missing records from option B whilst in the middle
of the process.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message