Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 76260 invoked from network); 25 Oct 2007 10:00:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 10:00:45 -0000 Received: (qmail 71190 invoked by uid 500); 25 Oct 2007 10:00:26 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 71159 invoked by uid 500); 25 Oct 2007 10:00:26 -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 71148 invoked by uid 99); 25 Oct 2007 10:00:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 03:00:26 -0700 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: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.104] (HELO web26015.mail.ukl.yahoo.com) (217.12.10.104) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 25 Oct 2007 10:00:29 +0000 Received: (qmail 55178 invoked by uid 60001); 25 Oct 2007 10:00:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=tgq2chsdBGZaP3dgNvdwTkrDCutKGfJCLq3pI3QRoTHT6RSlB0apTHMffqZyimV1BWJYXUif/FNwV+Nlgnm2Qm99VHGJyjGb8UZqxCvtjg3PXqhJi8UjOjwE3pwduwD6EskMbAf/8+xnShNAh9EgPnT1WtgUELNJx/N3Lc3Zk7o=; X-YMail-OSG: zCx7z44VM1meRo1sLjNOnKeT67WmPKrrxglfxVUdfmWwpABG7k2xI.HyPGp83N9IKmg0gZZ2y_sNw.iOPqp85JCCl5dRAovJ.IQ54wvOsY1AM5vEGLkLxSn5GFI- Received: from [193.36.230.96] by web26015.mail.ukl.yahoo.com via HTTP; Thu, 25 Oct 2007 10:00:04 GMT X-Mailer: YahooMailRC/814.06 YahooMailWebService/0.7.152 Date: Thu, 25 Oct 2007 10:00:04 +0000 (GMT) From: mark harwood Subject: Re: Lucene Queries Over User-Editable Dynamic Categories of Documents To: java-user@lucene.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <693739.47758.qm@web26015.mail.ukl.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org There are 2 considerations when caching filter results:=0A=0A1) What was th= e criteria used to produce the results?=0A2) What version of the index were= these results taken from?=0A=0ACachingWrapperFilter takes care of 2) by us= ing WeakHashMap keyed on IndexReader.=0A=0AThe filter you pass to CachingWr= apperFilter must play it's part in taking care of 1) by implementing hashco= de/equals.=0A=0AYou can then maintain an LRU hashmap of CachingWrapperFilte= rs to keep only the most popular filters.=0A=0AIncidentally, contrib's XMLQ= ueryParser handles all this for you with a simple "CachedFilter" tag:=0A=0A= =0A =0A "Brittany Spears"=0A =0A =0A =0A = =0A =0A =0A= =0A=0A=0ACheers=0AMark=0A=0A----- Original Message ----=0AFrom: lucene user= =0ATo: java-user@lucene.apache.org=0ASent: Thursday, 25 = October, 2007 10:36:14 AM=0ASubject: Re: Lucene Queries Over User-Editable = Dynamic Categories of Documents=0A=0AWhat do you means by 'Most caches are = held in WeakHashMap...' is this=0Acaching provided by CachingWrappingFilter= or do we have to implement it=0Aourselves? I assume the former.=0A=0AWe wi= ll share results of our testing as soon as we have any - not sure=0A how=0A= generalizable they will be.=0A=0AYou have been super helpful! Very grateful= ! Thanks!=0A=0AOn 10/24/07, markharw00d wrote:=0A= >=0A> lucene user wrote:=0A> > Thanks for all your help!=0A> >=0A> > We are= using Lucene 2.1.0 and TermsFilter seems to be new in Lucene=0A> 2.2.0.=0A= > > I have not been able to find SortedVIntList in the javadocs at all.=0A>= >=0A>=0A> No, SortedVIntList is in the patch I provided a link to earlier.= =0A>=0A>=0A> > Because both SortedVIntList and a regular BitSet are based o= n=0A Lucene=0A> > Document Numbers, which are not permanent, It seems we wi= ll need to=0A> > generate these objects fresh at least once per session. An= y=0A comments,=0A> > about that? Do I have that correct?=0A> >=0A> Yes. Mos= t caches tend to be held in WeakHashMap keyed on IndexReader=0A so=0A> that= when a new reader takes over old caches are automatically=0A garbage=0A> c= ollected.=0A>=0A>=0A> > Our application includes the following filter imple= mentation that=0A we use=0A> for=0A> > a=0A> > slightly different end user = category problem. We could easily use=0A it for=0A> our=0A> > current probl= em as well.=0A> >=0A> > Is TermsFilter sufficiently better (faster, more co= mpact, more=0A correct,=0A> > etc.) to make upgrading=0A> > very important?= =0A> >=0A> TermsFilter is in "contrib" and is stand-alone so should work wi= th=0A most=0A> Lucene versions.=0A> Your implementation looks to scan the w= hole termEnum whereas=0A TermsFilter=0A> looks up only the selected terms u= sing reader.termDocs(term).=0A> Benchmarking will tell you which is faster.= I'd be interested to know=0A> the results.=0A>=0A> Cheers=0A> Mark=0A>=0A>= =0A> ---------------------------------------------------------------------= =0A> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org=0A> Fo= r additional commands, e-mail: java-user-help@lucene.apache.org=0A>=0A>=0A= =0A=0A=0A=0A=0A ______________________________________________________= _____ =0AWant ideas for reducing your carbon footprint? Visit Yahoo! For Go= od http://uk.promotions.yahoo.com/forgood/environment.html --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org