Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 16498 invoked from network); 8 Nov 2008 20:05:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2008 20:05:51 -0000 Received: (qmail 95902 invoked by uid 500); 8 Nov 2008 20:05:52 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 95870 invoked by uid 500); 8 Nov 2008 20:05:52 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 95859 invoked by uid 99); 8 Nov 2008 20:05:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2008 12:05:51 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of almeidaraf@gmail.com designates 209.85.198.226 as permitted sender) Received: from [209.85.198.226] (HELO rv-out-0506.google.com) (209.85.198.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2008 20:04:33 +0000 Received: by rv-out-0506.google.com with SMTP id f6so1831887rvb.5 for ; Sat, 08 Nov 2008 12:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=+aD6XbrspowMKs6BILluhMWG0ze7qnmy4jtHelKuExg=; b=f9fgJz3Sdaw3JM/CctDk55lzXnn1SZ9h7nDGWdMeEpyFAvboL1qUPVz/DtjQpDGiPy 6K3Zgosj9lF0PUVqS/YaMnuUoDP6Q3CahoSC5xa1lQF1vFH8ApTpLIhBf/Cw97s8BRaL oYwJ6gR72RLBYLAk/wNzzfNmZpo7VJKMmehnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=el4A26k8vi1diHfiDhePQ/OBY66HDdWdPc8XAY9RHhCI8sVxQwm51pU3qFgFwr5Vss pYZ9tAIpje+fuVEmJ4NtYpfM0QfhcRdKsojMw3yBOnVyMduFdFY2eCzuIvqQXHGqsJ6v hY+09m9b9LgmRk1axOyFkkiqClwcSxr+d8Gtg= Received: by 10.141.23.7 with SMTP id a7mr2589597rvj.256.1226174706138; Sat, 08 Nov 2008 12:05:06 -0800 (PST) Received: from zim ([189.107.137.13]) by mx.google.com with ESMTPS id k2sm13981211rvb.1.2008.11.08.12.05.04 (version=SSLv3 cipher=RC4-MD5); Sat, 08 Nov 2008 12:05:05 -0800 (PST) Date: Sat, 8 Nov 2008 18:04:54 -0200 From: Rafael Cunha de Almeida To: java-user@lucene.apache.org Subject: Re: Lucene and JSP Message-Id: <20081108180454.83f53e05.almeidaraf@gmail.com> In-Reply-To: References: <20081107230416.4ca466cb.almeidaraf@gmail.com> X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On Sat, 8 Nov 2008 10:53:43 +0000 "Mindaugas Žakšauskas" 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