----- Original Message ----- From: "Erik Hatcher" <[EMAIL PROTECTED]> To: <java-user@lucene.apache.org> Sent: Wednesday, October 05, 2005 6:34 PM Subject: Re: IndexSearcher in servlet containers
> > On Oct 5, 2005, at 9:54 AM, Cyril Barlow wrote: > > Thanks all for your feedback. I'm going to look at building a > > dedicated > > server that keeps one IndexSearcher open and each servlet would use > > that. > > Either that or look deeper into the Jetty framework to see if I can > > simply > > invoke a global IndexSearcher when the server starts and use that. > > Not quite > > sure how. Luc, DelayCloseIndexSearcher looks like something that > > might be of > > help - I'll have a look at that as well. > > I'm really confused on the dilemma here. > > You can create a startup hook using one of the Servlet specification > listeners, create an IndexSearcher there, stuff it into application > scope (context.setAttribute()). > > There is no digging into Jetty's guts needed, just plain and simple > servlet API will suffice. > > Of course you'll also want a facility to re-instantiate the > IndexSearcher if the index is changing, but that is just building > upon the pieces I just described. > > Erik > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >You can create a startup hook using one of the Servlet specification > listeners, create an IndexSearcher there, stuff it into application > scope (context.setAttribute()). OK, I add a IndexSearcher object using the context.setAttribute(IS) but how do I refer back to it from the servlet code? ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]