Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 92276 invoked from network); 8 May 2010 00:30:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 May 2010 00:30:48 -0000 Received: (qmail 47986 invoked by uid 500); 8 May 2010 00:30:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 47956 invoked by uid 500); 8 May 2010 00:30:46 -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 47948 invoked by uid 99); 8 May 2010 00:30:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 May 2010 00:30:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erickerickson@gmail.com designates 74.125.83.48 as permitted sender) Received: from [74.125.83.48] (HELO mail-gw0-f48.google.com) (74.125.83.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 May 2010 00:30:39 +0000 Received: by gwj15 with SMTP id 15so1183514gwj.35 for ; Fri, 07 May 2010 17:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=V3U8cR7j8Kk+uMd7LqhtMmlPAEa0Ur2j9iqILxfUK4g=; b=dPhUyF5/a7aAkVVgqFlMfVYdaFOEGGIe5m2mPSfJnRVUMnAdUrhv0w9p/QVPjOcvrb S8129IjpacK1rGhrbft/GHLr6ksWbYl9/SQmA2M6BC0eG7JbxhPlNkDFIOIGBZ8DhY8W huVFE8FqsMYH26/0dw5zPor5ELwy/1IGjzCNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rRHUI2q+C2QpW12ltTrsjJZLb7oLX2c1IAzs+SNujMTg7bYHhkMyUIxTyQEeRH+BhW XFbGjtmydTBuzdg/IAlWRK3smVxBGbS4s5/cO+6rc6+PMYZiaH+Ni+7PPOCo3pphf+12 bVLqB3WYIq/Ypx8T0fj8ddGXcFBuEGx4M9uhQ= MIME-Version: 1.0 Received: by 10.151.3.25 with SMTP id f25mr4012384ybi.183.1273278618443; Fri, 07 May 2010 17:30:18 -0700 (PDT) Received: by 10.151.43.7 with HTTP; Fri, 7 May 2010 17:30:18 -0700 (PDT) In-Reply-To: <1273252766.3827.27.camel@tpoljak-laptop> References: <1273252766.3827.27.camel@tpoljak-laptop> Date: Fri, 7 May 2010 20:30:18 -0400 Message-ID: Subject: Re: TermsFilter instead of "should" TermQueries From: Erick Erickson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=000e0cd6a67ec09fb004860a47fa X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd6a67ec09fb004860a47fa Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > Hi, > in API documentation for TermsFilter: > > > 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: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --000e0cd6a67ec09fb004860a47fa--