lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "German Kondolf" <>
Subject Re: Closing index searchers ...
Date Thu, 29 Nov 2007 15:40:35 GMT
I had the same issue, and end up doing my own reference counting using
"acquire/release" strategy.

I used a single instance per searcher, every "acquire" counts +1 and
every "release" count -1, when a index is switched it receives a
"dispose" signal, then the release checks if there are processing
instances, if all releases were made then the last release closes the

The interface looked like this:

public interface Acquirable<R> {

	public R acquire();
	public void release();
	public boolean isAcquired();
	public boolean dispose();


In my implementation, I use a threadlocal to attach the searcher's
referenced instance (although it's a single instance per index

Hope it helps...


On Nov 29, 2007 12:15 PM, Dragon Fly <> wrote:
> Hi,
> My application needs to close/open the index searcher periodically so that newly added
documents are visible.  Is there a way to determine if there are any pending searches running
against an index searcher or do I have to do my own reference counting? Thank you.
> _________________________________________________________________
> You keep typing, we keep giving. Download Messenger and join the i'm Initiative now.

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

View raw message