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 01:10:17 GMT

On Oct 5, 2005, at 9:03 PM, Cyril Barlow wrote:

>
>
>>> I'm getting :
>>>
>>>  java.io.IOException: The handle is invalid at
>>> java.io.RandomAccessFile.seek(Native Method) at
>>>
>>
>> Did you perhaps close the IndexSearcher somewhere along the way?
>>
>>      Erik
>>
>
>
> No, but I'm now creating new IndexSearchers every servlet doPost  
> method and
> not closing them. It works without the caching probems for some  
> reason and
> it's much quicker?? I'm hoping the garbage collector sorts the  
> cleaning up
> though..

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


Mime
View raw message