lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cyril Barlow" <i...@fantasyfooty.org>
Subject Re: IndexSearcher in servlet containers
Date Thu, 06 Oct 2005 01:32:16 GMT

----- Original Message -----
From: "Erik Hatcher" <erik@ehatchersolutions.com>
To: <java-user@lucene.apache.org>
Sent: Thursday, October 06, 2005 2:10 AM
Subject: Re: IndexSearcher in servlet containers


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

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?


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

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