lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Streeton" <mike.stree...@ardentia.co.uk>
Subject RE: spring & lucene
Date Tue, 06 Jun 2006 08:01:47 GMT
We wrote ours for NetSearch to handle this specific issue. I suggest you
create a holder class to hold the IndexReader and IndexSearcher, this
can close them in the finalizer. Clients keep the holder until they are
finished and then discard it. When it is completely de-referenced it
will be closed. We also remove old indexes this way as well. Create a
factory class for the holder that knows when an index is being updated,
and creates new holders, when the index is not being updated it returns
the same one each time.

Mike

www.ardentia.com the home of NetSearch

-----Original Message-----
From: Rajiv Roopan [mailto:rajiv.roopan@gmail.com] 
Sent: 06 June 2006 05:28
To: java-user@lucene.apache.org
Subject: spring & lucene

Hello,
 I'm using the spring framework to define my indexsearcher and
indexwriter.   They are defined as persistent singletons in the
application.

I'm quite new to lucene and I realize that after updating an index
using IndexWriter you nead to re-create an instance of IndexSearcher
to search that newly updated index. I was wondering if anyone knew,
using spring, how to reload the IndexSearcher bean?

Thanks!
rajiv

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message