Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 20183 invoked from network); 9 May 2010 16:07:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 May 2010 16:07:48 -0000 Received: (qmail 78834 invoked by uid 500); 9 May 2010 16:07:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 78778 invoked by uid 500); 9 May 2010 16:07:45 -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 78770 invoked by uid 99); 9 May 2010 16:07:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 May 2010 16:07:45 +0000 X-ASF-Spam-Status: No, hits=-0.9 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [206.190.38.60] (HELO web50306.mail.re2.yahoo.com) (206.190.38.60) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 May 2010 16:07:39 +0000 Received: (qmail 64894 invoked by uid 60001); 9 May 2010 16:07:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1273421238; bh=RWqeQHfn1Z36+5b/pyDvEcPpYc2SKugMhxqb+LC4Irk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=i3fgrSlvXN0fGLsDvBUReAwWI5RWKApkClEptTWpPTOUQ4wXKK1DSTI/l7CVKb/jB9O2NvMISYqFQlpbEzXms5DEvRMSaF/kdA8n/DnJdaNH6RRSUQ4RmvqXf2F+9LhqBTOk3our81UJAx5dCFlJMJ0aSDB/KLUEvnZTVP+pVZ0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=SCOaJuMkFeU+TuKmISfM1bF6wM5IWtm+pEm3Rg7i3+ZE2Y/1kBMdwaHPihOW92ZB4LMWGoNflOvq3ZL1ZAvIr7z9UtJ4pUfz1WRsNcd4NI0J4fQzpJ+y1G1qE0q9jMfH65DIbOf2rnWdFOYKy+N/OvLYAPWdEpcuY/fhv4JOvp8=; Message-ID: <308550.64887.qm@web50306.mail.re2.yahoo.com> X-YMail-OSG: JvijITYVM1lyfdW3vAaXzLCbHe7VTk7rLkA4Ct6RfKDUkcd VQmB6UZSd_rM_ZNZzwSd5uubK7pyiLRRyXlEuwbcOurskhlK20sqMoXZw52l UBQT_JpUrvdrlTx2nVIjj6o0VRhbkUn3KXdjjimDeNv.PQS3Z9SZibzIlv1N cCnkMqfnAsX4ZcfLe9mKmu1F9u5LykT9FvGSy7Kv6EqzDGVMqC52wRGSdURM Ty.o_Z4Y5aeFj9KbbGe7rnCMf3gHylXaDo0CMAsK1zlhrD368UcEffnGHFl2 Q5b0ep3hRma33bezrKfDFxMVOmN73eY6BPVSqVd0hapqRGhmJJYwfULumm_2 ydafST_dnGDr1ImdQ1F.YNHBzQyGDdw-- Received: from [74.73.6.27] by web50306.mail.re2.yahoo.com via HTTP; Sun, 09 May 2010 09:07:18 PDT X-Mailer: YahooMailRC/374.4 YahooMailWebService/0.8.103.269680 References: <1273252766.3827.27.camel@tpoljak-laptop> Date: Sun, 9 May 2010 09:07:18 -0700 (PDT) From: Otis Gospodnetic Subject: Re: TermsFilter instead of "should" TermQueries To: java-user@lucene.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I think what Tomislav was trying to ask is: Can filters replace only strictly boolean clauses (i.e. only MUST and MUST_NOT), such as: +gender:F, -rating:xxx)? Or can filters also replace SHOULD clauses, such as: food:banana (which is neither absolutely required or strictly prohibited)? Otis ---- Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch Lucene ecosystem search :: http://search-lucene.com/ ----- Original Message ---- > From: Erick Erickson > To: java-user@lucene.apache.org > Sent: Fri, May 7, 2010 8:30:18 PM > Subject: Re: TermsFilter instead of "should" TermQueries > > Well, you construct the filter by enumerating the terms you're interested in > and pass it along to the relevant search. But it looks like you've > figured that part out. If you're asking how can you use a Filter and still > have the terms replaced by the filter contribute to scoring, you can't. But > it's a reasonable question to ask whether it changes the score enough > to matter given that this is only a problem when there are > many terms. If this doesn't speak to your question, can you ask for > more detail? HTH Erick On Fri, May 7, 2010 at 1:19 PM, > Tomislav Poljak < > href="mailto:tpoljak@gmail.com">tpoljak@gmail.com> wrote: > > Hi, > in API documentation for TermsFilter: > > > > href="http://search-lucene.com/jd/lucene/org/apache/lucene/search/TermsFilter.html" > target=_blank > >http://search-lucene.com/jd/lucene/org/apache/lucene/search/TermsFilter.html > > > it states: > > 'As a filter, this is much faster than the equivalent > query (a > BooleanQuery with many "should" TermQueries)' > > I > would like to replace "should" TermQueries with TermsFilter to benefit > > in performance, but I'm trying to understand how this change/switch can > > work. > > I was under the impression that the BooleanQuery with many > "should" > TermQueries affects scoring like: each "should" term present in > result, > increases the result's score. > > If someone could > explain how can a TermsFilter (which is like any filter > a binary thing - > result document is matched or not) be used to replace > should clauses, I > would really appreciate it. > > Tomislav > > > > --------------------------------------------------------------------- > To > unsubscribe, e-mail: > href="mailto:java-user-unsubscribe@lucene.apache.org">java-user-unsubscribe@lucene.apache.org > > For additional commands, e-mail: > ymailto="mailto:java-user-help@lucene.apache.org" > href="mailto:java-user-help@lucene.apache.org">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