----- Original Message -----
From: "Erik Hatcher" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to