From java-user-return-50104-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Tue Jun 21 00:27:50 2011 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 820A06E59 for ; Tue, 21 Jun 2011 00:27:50 +0000 (UTC) Received: (qmail 81584 invoked by uid 500); 21 Jun 2011 00:27:48 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 81538 invoked by uid 500); 21 Jun 2011 00:27:48 -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 81530 invoked by uid 99); 21 Jun 2011 00:27:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 00:27:48 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dotsid@gmail.com designates 74.125.82.176 as permitted sender) Received: from [74.125.82.176] (HELO mail-wy0-f176.google.com) (74.125.82.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 00:27:40 +0000 Received: by wyb36 with SMTP id 36so1528493wyb.35 for ; Mon, 20 Jun 2011 17:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type:subject:date :in-reply-to:to:references:message-id:x-mailer; bh=vU/3UPfC63RCrS8XmhQ5V6Ess2s/M6Q//AmOSKgWd00=; b=reX4f3YAFTMRk+DRFSEkUKMeyaLH5YupxurfW1L3AHXuAAc3Iuggpw+kgJQ4ZabDvO 54u5gTGCftEVOWlJpbHVewzWbr/1MlQ3qibOcVx7Lu2VaT8AR23cSwo1x8DLolpnXd7l YAnTM3onETRuJ3MFYC6DHx0lqnBYcLBJaQWYo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=mF3NyTb2fq9KYfo6ZaDVCT4HnTTFOLkOfCJIZ8KmdaDrgBUw2RfvA/RqBjCiU1Htrc CJy8d79klg1V9YfMj2x5Su7clqb1oGBhgiJ9cuJdyN7/2CD3IWfWIrWrUB8eRgSEoGpD 19LhLs8qVnxAy8S76ZTO5c93NDM84nDKDYk0c= Received: by 10.227.155.78 with SMTP id r14mr1579381wbw.100.1308616039104; Mon, 20 Jun 2011 17:27:19 -0700 (PDT) Received: from [172.16.31.9] (gw.farpost.ru [80.92.161.1]) by mx.google.com with ESMTPS id ge4sm3584697wbb.13.2011.06.20.17.27.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2011 17:27:18 -0700 (PDT) From: Denis Bazhenov Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/alternative; boundary=Apple-Mail-1--403649029 Subject: Re: how to do something like sql in () clause Date: Tue, 21 Jun 2011 11:27:12 +1100 In-Reply-To: <08230D4C8E666D479F6DE495A7684DCD0AC2EA42@JSCPCWEXMAA1.bsg.ad.adp.com> To: java-user@lucene.apache.org References: <08230D4C8E666D479F6DE495A7684DCD0AC2EA14@JSCPCWEXMAA1.bsg.ad.adp.com> <08230D4C8E666D479F6DE495A7684DCD0AC2EA42@JSCPCWEXMAA1.bsg.ad.adp.com> Message-Id: X-Mailer: Apple Mail (2.1084) --Apple-Mail-1--403649029 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii SQL IN operator behaves as OR operator. So as Occur.SHOULD does. It will = match 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/Bool= eanClause.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 = addressee and >> may contain information that is privileged and confidential. If the = reader 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 = this >> communication is strictly prohibited. If you have received this = communication 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 = addressee and > may contain information that is privileged and confidential. If the = reader 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 = this > communication is strictly prohibited. If you have received this = communication 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 --Apple-Mail-1--403649029--