lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Eriksson" <>
Subject Sequential writer/reader
Date Thu, 06 Mar 2003 15:30:11 GMT

We are working on a solution using Lucene to index 
3 million documents. The index is occasionally frequently updated, 
which makes the overhead for creating IndexReaders and IndexWriters huge.

When we want to update a document in the index, we start by searching
for the documentId based on a "column" specified in the document. This
is done using an IndexSearcher that is opened on the index. After we have found the documentId,
we delete the document using an IndexReader (which is then closed). The index is then updated
with a newly constructed document using an IndexWriter (which is the closed).
This procedure is then repeated for every update.

The writing and deletion in the index is all made by a single
java thread. Other than that thread, the index is only used for
searching. The question is then if it ok to have both an IndexReader 
and IndexWriter open at the same time (disregarding the write.lock in the index)? Is there
anything kept in memory by IndexReader and IndexWriter which makes this impossible or is it
only a problem if several threads are used to update an index at the same time ?

Is it ok to do unlock on the index (IndexReader.unlock) every time we want to add a new document
to the index, or is there some other way to solve this problem?

>From a performance point of view, its impossible to open and close a reader and writer
every time we want to make an addition to the index.

best regards,
Daniel Eriksson

Get Your Free E-mail at
Skaffa din egen webbaserade E-post Tjänst på

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

View raw message