Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 4251 invoked from network); 25 Feb 2007 14:19:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2007 14:19:18 -0000 Received: (qmail 35119 invoked by uid 500); 25 Feb 2007 14:19:20 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 35082 invoked by uid 500); 25 Feb 2007 14:19:20 -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 35071 invoked by uid 99); 25 Feb 2007 14:19:20 -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 06:19:20 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mnrz57@gmail.com designates 209.85.134.191 as permitted sender) Received: from [209.85.134.191] (HELO mu-out-0910.google.com) (209.85.134.191) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Feb 2007 06:19:09 -0800 Received: by mu-out-0910.google.com with SMTP id i10so1041716mue for ; Sun, 25 Feb 2007 06:18:48 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=h6vnyfyE7jUHC+l5meSfDEEqenNRhIZneLtqVHjoEluhL+FeBeG+uiS99o+FxfJ1PfNRQsv+KVYfzXXfeZ/VIuKPKcQPmy3k9JElG5bQzoq4+drzjisr0g4EqaSgJ5jM+cKQm+WzwIKIoUbks1q23X5hQyWD/OsCShAEYkTp2dg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=q3VWdOAvU8cG0XurfGx0WW/rP3R1FkdpwVHkwwXMSolxE20BOWxDSpDk7KVPREkSmU0+yA1mYSXK1+XJ0dQnoj8guIgENOH+EB1LurIk5OCECsNdrsf2bw/6xjBOKBK+v+cwRyYRrXMfEioRVyOD65VD9yHppes192RKgPjg7eo= Received: by 10.82.135.13 with SMTP id i13mr1330235bud.1172413128027; Sun, 25 Feb 2007 06:18:48 -0800 (PST) Received: by 10.82.163.2 with HTTP; Sun, 25 Feb 2007 06:18:47 -0800 (PST) Message-ID: <34b8543c0702250618p11021435q373ba7a95139b75a@mail.gmail.com> Date: Sun, 25 Feb 2007 17:48:47 +0330 From: "Mohammad Norouzi" To: java-user@lucene.apache.org Subject: Re: how to define a pool for Searcher? In-Reply-To: <45E19739.30709@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55982_20767922.1172413127987" References: <34b8543c0702220009m72f9e9c7pf8f9764953be6a48@mail.gmail.com> <45DDE5DA.80202@gmail.com> <34b8543c0702242104o7317f95bt3b989b98ccb213b8@mail.gmail.com> <45E19739.30709@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_55982_20767922.1172413127987 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi actually I dont have any writer or writing reader. I just have reader. when a reader is created by the user because the document returned by hits is very much, for example 20,000 so I display the result page by page. whenever user click to next page the hits will use the reader to load next 20 records, besides, I dont have one directory, there are more than one directory and index on the server and each user may request for one of them. the problem is, a user may close his browser window and the reader will stay open becasue I cant detect it. and either if his session expires my destroy method will be called and searcher will close but in the cached searcher i can not detect which one is closed and ready it for next user. if the searcher had a isClosed() method it was easy to determine but unfortunately it's has'nt any idea? thanks again On 2/25/07, Mark Miller wrote: > > I am a bit confused about what you are asking. Why do you need the > Searcher to time out? That code should release your searchers at the > appropriate times...when the index has been modified. The way that I use > it is to make a synchronized map that keeps around an index accessor for > each index that I open...from there the code should do the rest...when a > writer or a writing reader is released the code waits for all searchers > to be released and then clears the cache of searchers and new searchers > are created when requested until another writer or writing reader is > released... > > Mohammad Norouzi wrote: > > Thank you Mark for your useful help. the code you introduce was very > > helpful > > for me > > > > but my only question is that I need to place an idle time for each open > > searcher, so if it exceed the specific time then release that searcher > > and > > get ready for another thread. > > > > how can I put such this feature, I was thinking of a timeout listener, > > but > > dont know where tu put it. I have a SingleSearcher that wraps lucene's > > Searcher and it returns an ResultSet in which I put a Hits object. do > > I have > > to put the time in my ResultSet or my SingleSeacher? > > > > 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? > > > > Thank you very much again. > > > > On 2/22/07, Mark Miller wrote: > >> > >> I would not do this from scratch...if you are interested in Solr go > that > >> route else I would build off > >> http://issues.apache.org/jira/browse/LUCENE-390 > >> > >> - Mark > >> > >> Mohammad Norouzi wrote: > >> > Hi all, > >> > I am going to build a Searcher pooling. if any one has experience on > >> > this, I > >> > would be glad to hear his/her recommendation and suggestion. I want > to > >> > know > >> > what issues I should be apply. considering I am going to use this on > a > >> > web > >> > application with many user sessions. > >> > > >> > thank you very much in advance. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > >> For additional commands, e-mail: java-user-help@lucene.apache.org > >> > >> > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > -- Regards, Mohammad ------=_Part_55982_20767922.1172413127987--