lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Cunha de Almeida <almeida...@gmail.com>
Subject Re: Lucene and JSP
Date Sat, 08 Nov 2008 20:04:54 GMT
On Sat, 8 Nov 2008 10:53:43 +0000
"Mindaugas Žakšauskas" <mindas@gmail.com> wrote:

> > How do I keep only one IndexSearcher open for all the searches on my
> > website?
> 
> In order to keep your IndexSearcher open, simply do not close it and
> serve the reference to the same object instance for different HTTP
> request clients.
> 
> This can easily be achieved using Singleton wrapper around
> IndexSearcher which would be sitting somewhere in your backend server
> API.
> 
> m.

Yeah, I was worried because all the documentation I read didn't tell me
how to control when the servlet is loaded and when it's unloaded. So I
thought that, since I had no control, maybe the server would reload the
servlet more times than it should. But experimenting with tomcat5.5
revealed that it's not really common for the servlet to be reloaded.

I was a bit to worried about the costs of opening more than one
IndexSearcher at the same time and reopening it a few times (I only
reindex stuff once per semester). Now I realise that I was being too
worried about that, you just shouldn't reopen IndexSearcher too often,
but it's completely fine to reopen it every now and then. I was just
being paranoid :-P.

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