Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E3BCF994 for ; Tue, 26 Mar 2013 19:10:19 +0000 (UTC) Received: (qmail 10906 invoked by uid 500); 26 Mar 2013 19:10:16 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 10851 invoked by uid 500); 26 Mar 2013 19:10:16 -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 10840 invoked by uid 99); 26 Mar 2013 19:10:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 19:10:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of welshwang@gmail.com designates 209.85.128.174 as permitted sender) Received: from [209.85.128.174] (HELO mail-ve0-f174.google.com) (209.85.128.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 19:10:11 +0000 Received: by mail-ve0-f174.google.com with SMTP id jz10so3503047veb.33 for ; Tue, 26 Mar 2013 12:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=IJaryUMTYJag87sT0wDEFF8DliFcyEgEGO4BGLu07P8=; b=n0DDxAg05KKZ2Wi82Er2H9PXzD4iMfiFN7v9VRjFuTrj6TaZZ/dC/DK3GLIC8R2kab 6HW6dpG4c9yMijT69Pfsoo/eldSWjRp5yQ5QjdqAtd8/1Dxz4hyZ0zDuT79DoypyJkGA crJa6IR/JZe24XDJwNcdD3ZdWiNPEqlT707h5O8GCq8MreHbn8Xn4H+ILkDs/V5yY1oc WKNxChxkVxVXTRB96Ql6N6ROR6p74HlMPuQHoKcQCxrFRnejNtFTVnjEVQ6yauOuYjzk zsPlvo4XdKHPDls9epd/TXSSR1Qf0uiYqUmkLE+q/JjbHfOG1Wga8Av9MzPQx4VETY2c 9EVg== MIME-Version: 1.0 X-Received: by 10.52.174.84 with SMTP id bq20mr17589414vdc.128.1364324990748; Tue, 26 Mar 2013 12:09:50 -0700 (PDT) Received: by 10.52.28.71 with HTTP; Tue, 26 Mar 2013 12:09:50 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Mar 2013 12:09:50 -0700 Message-ID: Subject: Re: Filter based on the sum of values of two fields From: Wei Wang To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Can someone give some hint on this? Or this is a tough problem. Thanks in advance. On Sun, Mar 24, 2013 at 2:46 AM, Wei Wang wrote: > Hello, > > We have documents with many numerical fields. In some search scenario, > we would like to create a filter based on the sum of the values of two > fields. > > For example, assume we have fields F1 and F2, we would like to find > all documents with condition F1+F2 > 5.0. This filter may be combined > with other filters to form a BooleanFilter. > > The question is, is there any way to construct an efficient filter to do this? > > We know it is possible to pre-compute another field F3 with sums of > corresponding F1 and F2 values and then filter based on the values of > F3. However, we have too many possible combination of pairs of > numerical fields which leads to large number of aggregated fields such > as F3. Can we directly use the values of F1 and F2 to create a filter? > > Thanks, > Wei --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org