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 E961561B5 for ; Tue, 21 Jun 2011 01:16:24 +0000 (UTC) Received: (qmail 28159 invoked by uid 500); 21 Jun 2011 01:16:22 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 28116 invoked by uid 500); 21 Jun 2011 01:16:22 -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 28108 invoked by uid 99); 21 Jun 2011 01:16:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 01:16:22 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dean.hiller@broadridge.com designates 64.18.2.217 as permitted sender) Received: from [64.18.2.217] (HELO exprod7og115.obsmtp.com) (64.18.2.217) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 01:16:13 +0000 Received: from gwm.broadridge.com ([167.212.2.254]) (using TLSv1) by exprod7ob115.postini.com ([64.18.6.12]) with SMTP ID DSNKTf/wx6CYO8W7joekripZGKH8s0mrxLZl@postini.com; Mon, 20 Jun 2011 18:15:52 PDT Received: from jsppsldlpsi01.broadridge.net ([10.98.54.11]) by gwm.broadridge.com (8.13.8+Sun/8.13.8) with ESMTP id p5L1Fjfq016675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Jun 2011 21:15:46 -0400 (EDT) Received: from JSIPSWEXHA01.bsg.ad.adp.com (jsipswexha01.bsg.ad.adp.com [10.17.69.24]) by jsppsldlpsi01.broadridge.net (RSA Interceptor) for ; Mon, 20 Jun 2011 21:15:43 -0400 Received: from jscpcwexmaa1.bsg.ad.adp.com ([fe80::882f:16e8:308d:3ef]) by JSIPSWEXHA01.bsg.ad.adp.com ([::1]) with mapi; Mon, 20 Jun 2011 21:15:41 -0400 From: "Hiller, Dean x66079" To: "java-user@lucene.apache.org" Date: Mon, 20 Jun 2011 21:15:39 -0400 Subject: RE: how to do something like sql in () clause Thread-Topic: how to do something like sql in () clause Thread-Index: Acwvqg6Wc0tCOeW/R26Bcdhu0MQyvgABqdnQ Message-ID: <08230D4C8E666D479F6DE495A7684DCD0AC2EA4B@JSCPCWEXMAA1.bsg.ad.adp.com> References: <08230D4C8E666D479F6DE495A7684DCD0AC2EA14@JSCPCWEXMAA1.bsg.ad.adp.com> <08230D4C8E666D479F6DE495A7684DCD0AC2EA42@JSCPCWEXMAA1.bsg.ad.adp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-RSA-Inspected: yes X-RSA-Classifications: public X-RSA-Action: allow X-Virus-Checked: Checked by ClamAV on apache.org Thanks much,=20 Dean -----Original Message----- From: Denis Bazhenov [mailto:dotsid@gmail.com]=20 Sent: Monday, June 20, 2011 6:27 PM To: java-user@lucene.apache.org Subject: Re: how to do something like sql in () clause SQL IN operator behaves as OR operator. So as Occur.SHOULD does. It will ma= tch document only if _one or more_ of the child queries match. BooleanQuery query =3D new BooleanQuery(); query.add(new TermQuery(new Term("accountId", "1")), Occur.SHOULD); query.add(new TermQuery(new Term("accountId", "2")), Occur.SHOULD); query.add(new TermQuery(new Term("accountId", "3")), Occur.SHOULD); On Jun 21, 2011, at 11:01 AM, Hiller, Dean x66079 wrote: > But the issue is that it MUST be 1, OR MUST be 2 so does that still work? >=20 > Also, how do you write that in the query syntax? >=20 > Thanks, > Dean >=20 > -----Original Message----- > From: Denis Bazhenov [mailto:dotsid@gmail.com]=20 > Sent: Monday, June 20, 2011 5:50 PM > To: java-user@lucene.apache.org > Subject: Re: how to do something like sql in () clause >=20 > You could use BooleanQuery with Occur.SHOULD quantificator >=20 > http://lucene.apache.org/java/3_0_3/api/core/org/apache/lucene/search/Boo= leanClause.Occur.html#SHOULD >=20 > On Jun 21, 2011, at 9:24 AM, Hiller, Dean x66079 wrote: >=20 >> I need to do something like a lucene query with >>=20 >> Where accountId in ( 1, 2, 3, 4) >>=20 >> Is there a way to do that in Lucene Query language? >>=20 >> Thanks, >> Dean >>=20 >> This message and any attachments are intended only for the use of the ad= dressee and >> may contain information that is privileged and confidential. If the read= er of the=20 >> message is not the intended recipient or an authorized representative of= the >> intended recipient, you are hereby notified that any dissemination of th= is >> communication is strictly prohibited. If you have received this communic= ation in >> error, please notify us immediately by e-mail and delete the message and= any >> attachments from your system. >>=20 >=20 > --- > Denis Bazhenov >=20 >=20 >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org >=20 > This message and any attachments are intended only for the use of the add= ressee and > may contain information that is privileged and confidential. If the reade= r of the=20 > message is not the intended recipient or an authorized representative of = the > intended recipient, you are hereby notified that any dissemination of thi= s > communication is strictly prohibited. If you have received this communica= tion in > error, please notify us immediately by e-mail and delete the message and = any > attachments from your system. >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org >=20 --- Denis Bazhenov This message and any attachments are intended only for the use of the add= ressee and may contain information that is privileged and confidential. If the reade= r of the = message is not the intended recipient or an authorized representative of = the intended recipient, you are hereby notified that any dissemination of thi= s communication is strictly prohibited. If you have received this communica= tion in error, please notify us immediately by e-mail and delete the message and = any attachments from your system. =0D --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org