lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <>
Subject RE: searching while indexing.
Date Wed, 05 Jan 2005 11:14:11 GMT
Peter Veentjer - Anchor Men writes:
> >>Is your IndexReader doing deletes?  
> Yes.. I have to remove the documents I`m going to update from the
> Reader. 
> >>That is the only time it locks the index (because that is essentially 
> >>a write operation).  If you're purely searching with the reader it 
> >>should work fine with a writer concurrently.
> Ok, I understand why there are problems. But how can I fix this problem?
> I have to update documents, so how can I do this without deleting
> documents from the Reader? I don`t want to add the same document twice. 
You have to bundle all writes at one point and serialize deletions and
That is:
open a reader for deleting
delete the documents to be deleted
close that reader
open a writer for adding content
add documents
close that writer
begin at start.

It's up to you, whether you open a reader to delete single documents and
a writer for adding a single document or use batches of several documents,
but you cannot escape the need to serialize the writes.


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

View raw message