Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 60818 invoked from network); 17 Apr 2008 07:07:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2008 07:07:46 -0000 Received: (qmail 72238 invoked by uid 500); 17 Apr 2008 07:07:38 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 72195 invoked by uid 500); 17 Apr 2008 07:07:38 -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 72184 invoked by uid 99); 17 Apr 2008 07:07:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 00:07:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [194.109.24.36] (HELO smtp-vbr16.xs4all.nl) (194.109.24.36) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 07:06:46 +0000 Received: from k8u.lan (porta.xs4all.nl [80.127.24.69]) by smtp-vbr16.xs4all.nl (8.13.8/8.13.8) with ESMTP id m3H777Bu007485 for ; Thu, 17 Apr 2008 09:07:07 +0200 (CEST) (envelope-from paul.elschot@xs4all.nl) From: Paul Elschot To: java-user@lucene.apache.org Subject: Re: QueryWrapperFilter question... Date: Thu, 17 Apr 2008 09:07:06 +0200 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) References: <652776090804161104m5909f735pa80fe44414faf1d4@mail.gmail.com> <4806AB3A.7000106@gmail.com> <652776090804162137u1dd46b2et8ac02ae8d4872a13@mail.gmail.com> In-Reply-To: <652776090804162137u1dd46b2et8ac02ae8d4872a13@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804170907.07129.paul.elschot@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org Op Thursday 17 April 2008 06:37:18 schreef Michael Stoppelman: > Actually, I screwed up the timing info. I wasn't including the time > for the QueryWrapperFilter#bits(IndexReader) call. Sadly, > it actually takes longer than the original query that had both terms > included. Bummer. I had really convinced myself till the > thought came to me at lunch :). For a single query, adding a filter off course has a cost. But when the location part can be reused in later queries, give CachingWrapperFilter a try. Regards, Paul Elschot > > -M > > On Wed, Apr 16, 2008 at 6:43 PM, Karl Wettin wrote: > > Michael Stoppelman skrev: > > > > Hi all, > > > > > I've been doing some performance testing and found that using > > > QueryWrapperFilter for a location field > > > restriction I have to do allows my search results to approach > > > 5-10ms. This > > > was surprising. > > > Before the performance was between 50ms-100ms. > > > > > > The queries from before the optimization look like the following: > > > +(+(text:cats) +(loc:1 loc:2 loc:3 ...)) > > > > > > The QueryWrapperFilter does do a search itself. Why would > > > performance be so > > > drastically different when the > > > QueryWrapperFilter needs to do a search? Does lucene just not > > > have the statistics to optimize this query so it > > > can decide which terms to filter by first? > > > > Do you wonder why a QueryWrapperFilter is faster than a Query? Then > > the answer is that the filter uses a bitset to know if a document > > matches a document or not. For each document that match text:cats > > it checks the flag in the bitset for that document number instead > > of seeking in the index to find out if also match loc:1, loc:2 or > > loc:3. > > > > > > karl > > > > ------------------------------------------------------------------- > >-- 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