From java-user-return-63968-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Aug 24 15:35:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E0FCE180677 for ; Fri, 24 Aug 2018 15:35:05 +0200 (CEST) Received: (qmail 84064 invoked by uid 500); 24 Aug 2018 13:34:59 -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 84033 invoked by uid 99); 24 Aug 2018 13:34:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2018 13:34:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A3005C0574; Fri, 24 Aug 2018 13:34:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.138 X-Spam-Level: X-Spam-Status: No, score=0.138 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Kaw1oeaVY2jQ; Fri, 24 Aug 2018 13:34:56 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 4824B5F3EE; Fri, 24 Aug 2018 13:34:56 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id f38-v6so5837034edd.8; Fri, 24 Aug 2018 06:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3Qx5HOn/JxOmTt2zQXJs8DyfHkXYy2mx78Cl0YLy0yg=; b=jSDM8WnGI8L39kVKo5hmPgd6BpmlaQLV0pQGJH7xleKRlDZmyoAXpVvVS8sAEt6Xod UKrSTJUtQ+7WwRpgV5qNiJy1vPBF+MtgmjRfD4nLA/NNZHX4kCMgzSAXgcepg12Ld9JV YDNhzmJ9tXeXCQaaz2lLUqpRYW2ksWGrn4CERsgi252XBcshRN+AGUKtKztg4ptSeBQw lgVCPoiGC/YYFU5/5bjzzafv1l9RbAqeFtUdIXk+4iWYNViIWamLwJ3VScdxkZOVSILy GQ26LwUaa1vQgFlPoZ38mcfjengON8vh5Zg9EV37bznsm2eeVI2INxTTuZ23ELi7fnwc wV6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3Qx5HOn/JxOmTt2zQXJs8DyfHkXYy2mx78Cl0YLy0yg=; b=P3WeVrrbNCydIEBuT0UQNdL5vHHLVdW1gKnjFQq4s2AEAysjgeFC/UL6kw3seJ9Uh4 gOUu4FRh6UCkaP/mWjkQNwxUEYD4YzV4CJJPYXR/gGtlwh7kylCkaoXOaK94Xak3cr33 wiibC3fu2AQas2b6bB3d3hUSYYuIUTWizJo7cYaJO4bXzoer0hFJb70CTITJfNqw69TA 4qoKtzgUV8PdQQTXqEin1IpkJLCUdPXL7STjvgsIQ6PgJc/+JNNpHjRI0c+SAZwsPK+B nQ7URvWTzAkaxdbw8BX/ypjRvqaF2XR2opp17L4Xa3bImmgKcXlbrsMOC5Np7Yakq2CS JsRQ== X-Gm-Message-State: APzg51DG/56Erp69QLz5isKM1KEYiH365p20HDtAeYU6gi6yrh/8J+5x LISOMSYB2xaKnt2ky7hwJ3bkPWRFtSXEAIG+Ud6Erg== X-Google-Smtp-Source: ANB0VdbNU0sjs2DkWhS07kQdl5MEPf4H7/9QAChT0519A2Om6zKSe5Z/XPwiThuLTigGXe8I6TJitalXEtbqO3zj2Jc= X-Received: by 2002:aa7:d443:: with SMTP id q3-v6mr2672146edr.109.1535117695051; Fri, 24 Aug 2018 06:34:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tomoko Uchida Date: Fri, 24 Aug 2018 22:34:44 +0900 Message-ID: Subject: Re: SQL OR in lucene : where ((term1=a and term2=b) OR (term3=a and term4=b)) and context in (2,3,4,5.....200) To: java-user@lucene.apache.org Cc: general@lucene.apache.org, dev@lucene.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Khurram, Lucene query parser's OR operator or Occur.Should are work as expected for me, I suspect you could miss some points. > roughly in lucene > (+term1:a +term2:b) (+term3:a and +term4:b) #context:2 4 7 ... 198 It does not look like an ordinary lucene query string to me ('#' is not an operator of StandardQueryParser or ClassicQueryParser,) which parser do you use? If you try to build a query by Java code, I suggest you post your exact code snippet. p.s. dev mailing list is not for user questions, you should post such questions to java-user list only, anyway. ;) Regards, Tomoko 2018=E5=B9=B48=E6=9C=8824=E6=97=A5(=E9=87=91) 19:45 Khurram Shehzad : > > Hi, > > > I have a requirement to replicate following SQL query logic containing OR= condition as > > where > > ((term1=3Da and term2=3Db) OR (term3=3Da and term4=3Db)) and context in (= 2,3,4,5.....200) > > > roughly in lucene > > > (+term1:a +term2:b) (+term3:a and +term4:b) #context:2 4 7 ... 198 > > > It doesn't seem to me getting desired effect of "OR" logic using Occur.Sh= ould. > > > Above lucene query will retrieve all documents satisfying context conditi= on and disregarding first two conditions. > > > But it can be workable, if I manage to apply context condition separately= . > > > More probably using custom filtering through Collector interface https://= lucene.apache.org/core/7_3_1/core/org/apache/lucene/search/Collector.html. > > > Any idea please. > > > Regards, > Khurram -- Tomoko Uchida --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org