Re: how to safely periodically reopen the IndexReader?

2008-02-21 Thread Stephane Nicoll
On Mon, Feb 18, 2008 at 6:08 PM, [EMAIL PROTECTED] wrote: We have the same situation and use an atomic counter. Basically, we have a SearcherHolder class and a SearcherManager class. The SearcherHolder holds the searcher and the number of threads referencing the searcher. When the

Re: how to safely periodically reopen the IndexReader?

2008-02-20 Thread zaexage
Yes, I'm using a solution quite similar to this one. :) But when I read the Lucene 2.3 IndexReader.java code and javadoc, I see they have added a synchronous reference-counter to IndexReader and when it drops to zero, this instance will automatically call doClose() to clean, but the manipulator

Re: how to safely periodically reopen the IndexReader?

2008-02-18 Thread Robert . Hastings
We have the same situation and use an atomic counter. Basically, we have a SearcherHolder class and a SearcherManager class. The SearcherHolder holds the searcher and the number of threads referencing the searcher. When the thread that writes to the index closes the index, it sends an event

RE: how to safely periodically reopen the IndexReader?

2008-02-16 Thread John Griffin
Your users won't appreciate your closing the searcher on them. That is, if you have a highly concurrent system. I don't know about 2.3.0 yet. Haven't had much chance to see the changes but with 2.2.0 I use an atomic counter. It's not that much to program. Regards, John G. -Original