lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <DCutt...@grandcentral.com>
Subject RE: problems with last patch (obtain write.lock while deleting d ocuments)
Date Sun, 10 Feb 2002 23:51:18 GMT
> From: Daniel Calvo [mailto:dcalvo@ig.com.br]
> 
> Problem solved, thanks!

Great!

> BTW, is the way I'm doing the deletion the correct one? I 
> reckon I can't use a cached reader, since I have to close it after the
> deletion to release the write lock. Does it make sense?

Yes.  Looks good to me.

It is most effiecient to batch deletions and insertions, i.e., perform a
bunch of deletions on a single IndexReader, close it, then perform a bunch
of insertions on a single IndexWriter.  Usually the IndexReader that you do
the deletions on is different than the one other threads are simultaneously
using for searching, since if you close a reader while a search is underway
it will crash the search.

> Regarding writers, is it ok to share a single IndexWriter 
> with multiple
> writers, i.e., I have one writer adding a document and then I 
> get another request for doc upload. I can't open a new IndexWriter
> because of the write lock, so I'm using the one already 
> available. After all writers are done, the IndexWriter is closed.

That also sounds fine.

Doug

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message