lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Smith <n...@techop.ch>
Subject Re: IndexReader and IndexWriter on the same index
Date Wed, 28 Nov 2001 11:04:07 GMT
Doug Cutting wrote:
> 
> > From: Avi Drissman [mailto:avi_drissman@baseview.com]
> >
> > But if I need to do a deletion before every addition, then there's
> > the overhead of all those reader and writer creations. There's no way
> > around it?
> 
> Batch your deletions, then batch your additions.  If you need these changes
> to appear atomically to searchers, do not re-open the IndexReader that
> you're using for searching until you have closed the IndexWriter.
> 
> Doug
> 
I am faced with a similar problem to Avi and I have a question :

I have multiple threads peforming inserts, and searches on an index.
The IndexReader/IndexSearcher instances are refreshed when a search
thread detects that the modification time of the index changes (before
IndexSearcher.search() is called).
Refresh includes :
o	synchcronise on all readers and writers.
o	peform any queued deletes using IndexReader.delete().
o	call IndexReader.close() to flush deletes to the index.
o	open new IndexReader/IndexSearcher.

Do I also need to re-create the IndexWriter instance?

Many Thanks for any answers!

Nick Smith

--
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