Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 82328 invoked from network); 25 Feb 2007 12:32:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2007 12:32:58 -0000 Received: (qmail 57810 invoked by uid 500); 25 Feb 2007 12:33:00 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 57766 invoked by uid 500); 25 Feb 2007 12:33:00 -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 57755 invoked by uid 99); 25 Feb 2007 12:33:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Feb 2007 04:33:00 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of karl.wettin@gmail.com designates 64.233.182.190 as permitted sender) Received: from [64.233.182.190] (HELO nf-out-0910.google.com) (64.233.182.190) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Feb 2007 04:32:48 -0800 Received: by nf-out-0910.google.com with SMTP id i2so1337325nfe for ; Sun, 25 Feb 2007 04:32:27 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=XPxhxtDFFe2wNMruMX4NzEcIpP4BqPeGRcDd1BvadSnFUiDQD2JDmZUKjTlb7i4b+JeV0yQeihXD1+awfH9G9CO2/wHjLULXFGSYyg4YLo8M7qGbXhwmrreZ68CIAJkQrhtlrsqm6ORyB/2miQjrf6wld1KFn1NdHmRtKXP7oaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=TXX/8oejO4f6ddYPILwhujR14KO9Wr11lr/KRxrNy6HybVkl2Xm7qo2nRfa250ynykSa1krtqY5PniOdDgL4WkQNETFq2HZMnQYYcCNdQ4mjHNJrcx+gac5zNODqta+m9AsXkIwq1FCOEBiFUnFxkOotY4ey9KONY90FmSW7UKQ= Received: by 10.49.42.5 with SMTP id u5mr10264021nfj.1172406747397; Sun, 25 Feb 2007 04:32:27 -0800 (PST) Received: from ?192.168.1.3? ( [83.249.110.75]) by mx.google.com with ESMTP id l22sm16954363nfc.2007.02.25.04.32.26; Sun, 25 Feb 2007 04:32:26 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <34b8543c0702242104o7317f95bt3b989b98ccb213b8@mail.gmail.com> References: <34b8543c0702220009m72f9e9c7pf8f9764953be6a48@mail.gmail.com> <45DDE5DA.80202@gmail.com> <34b8543c0702242104o7317f95bt3b989b98ccb213b8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6A95E03D-5E7E-417A-A2E4-481C87F61034@gmail.com> Content-Transfer-Encoding: 7bit From: karl wettin Subject: Re: how to define a pool for Searcher? Date: Sun, 25 Feb 2007 13:30:33 +0100 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org 25 feb 2007 kl. 06.04 skrev Mohammad Norouzi: > still I dont know ehrthrt the reader is important for Hits or > Searcher? > consider I passed a hits to my ResultSet, now, if I close searcher, > will the > Reader get closed? or another vague thing is can a Reader work thread > safely for every Searcher with differenet queries? I'm not completely sure what you are asking, so I hope this helps: If you passed a Directory to the IndexSearcher constructor the IndexReader within will be created at IndexSearcher construction time and closed at IndexSearcher close time. If you passed an IndexReader to the IndexSearcher constructor, then the IndexReader will not be closed when the IndexSearcher closes. If you do it this way be careful not to leave unused open IndexReader:s around, as they consume memory. An IndexSearcher requires the IndexReader associated with it to be open, and the same goes for any Hits produced by that IndexSearcher. However, the results in Hits are cached, so even if you close the IndexReader you will be able to access the top n accessed documents. You will always be able to access the document numbers and their score, as that does not require any access of the IndexReader. I.e. accessing documents from Hits requires an open IndexReader. -- karl --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org