I just create a new IndexSearcher, leave the old IndexSearcher alone,
and JVM's garbage collection cleans it up.

Otis

--- "Crump, Michael" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
>  
> 
> I am currently working on a server app that will require the ability
> to
> make index additions/deletions at any time.  I want to cache/reuse
> index
> searchers and readers.  I know that once an index has changed only
> newly
> opened readers will see the changes.  Creating a new reader to see
> the
> changes and caching it will be no problem.  My  problem is that since
> this is a multithreaded app other threads may be using the old
> readers
> making it difficult to know when to close them.  I assume that a
> reader
> must be closed to free the associated resources.  I was thinking
> about
> using some kind of reference counted reader that would keep track of
> its
> references and only truly close when there were no references.
> 
>  
> 
> Am I making this too difficult?
> 
>  
> 
> Is there a better way?
> 
>  
> 
> I assume others have had to do this using Lucene, do you have any
> recommendations?
> 
>  
> 
> Regards,
> 
>  
> 
> Michael
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to