Doug Cutting wrote: > > > From: Avi Drissman [mailto:[EMAIL PROTECTED]] > > > > 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:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
