lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: IndexSearcher in servlet containers
Date Thu, 06 Oct 2005 12:36:30 GMT

On Oct 5, 2005, at 9:32 PM, Cyril Barlow wrote:
>> Creating an IndexSearcher for every request goes against how to use
>> Lucene best.  A _single_ IndexSearcher for all searches is optimum.
>>
>> You really ought to look into using a single instance.
>>
>>      Erik
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
> Actually scrap that idea - it's back to caching problems again,  
> back to find
> a work around for the single instance indexsearcher- there probably  
> is a
> close method somewhere I've not commented out in the servlet..
> When you create a IndexSearcher with a string directory rather than an
> IndexReader - do you still have an IndexReader underneath - and if  
> so do you
> have to close that as well as an IndexSearcher?

There really is no need to close an IndexSearcher until you need to  
instantiate another one, and even then you can let the old instance  
go without closing and all will still be well.  If you construct  
IndexSearcher with a String directory name, there is no need to close  
anything other than (optionally) the IndexSearcher.

     Erik


---------------------------------------------------------------------
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