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 Wed, 05 Oct 2005 19:20:49 GMT

On Oct 5, 2005, at 2:09 PM, Cyril Barlow wrote:
>> 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.
>>
>
> OK, I add a IndexSearcher object using the context.setAttribute(IS)  
> but how
> do I refer back to it from the servlet code?

Uh... IndexSearcher searcher = (IndexSearcher) context.getAttribute 
("<some key>")

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