lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: continuous index updates
Date Fri, 20 Aug 2004 18:41:07 GMT
I just create a new IndexSearcher, leave the old IndexSearcher alone,
and JVM's garbage collection cleans it up.

Otis

--- "Crump, Michael" <mcrump@leadscope.com> 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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message