Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E756200B59 for ; Mon, 8 Aug 2016 23:22:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1D195160A91; Mon, 8 Aug 2016 21:22:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6169F160A77 for ; Mon, 8 Aug 2016 23:22:34 +0200 (CEST) Received: (qmail 89649 invoked by uid 500); 8 Aug 2016 21:22:28 -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 89637 invoked by uid 99); 8 Aug 2016 21:22:27 -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; Mon, 08 Aug 2016 21:22:27 +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 8561EC03BC for ; Mon, 8 Aug 2016 21:22:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.228 X-Spam-Level: X-Spam-Status: No, score=-0.228 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RP_MATCHES_RCVD=-1.426, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id aRC0gPfpk8Fn for ; Mon, 8 Aug 2016 21:22:25 +0000 (UTC) Received: from nm24-vm4.bullet.mail.gq1.yahoo.com (nm24-vm4.bullet.mail.gq1.yahoo.com [98.136.217.99]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 512C95F484 for ; Mon, 8 Aug 2016 21:22:24 +0000 (UTC) Received: from [98.137.12.59] by nm24.bullet.mail.gq1.yahoo.com with NNFMP; 08 Aug 2016 21:22:16 -0000 Received: from [98.137.12.195] by tm4.bullet.mail.gq1.yahoo.com with NNFMP; 08 Aug 2016 21:22:16 -0000 Received: from [127.0.0.1] by omp1003.mail.gq1.yahoo.com with NNFMP; 08 Aug 2016 21:22:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 853520.18425.bm@omp1003.mail.gq1.yahoo.com X-YMail-OSG: 4Us_iOMVM1mDz.wkAoz6u.cOWNw1oUQn..p33J5bwe167bKP.0G2WtHKZvXZBcV g_qHdy0KYpMc_zJhfN2dogkcN9kYITXIfIDy2xJdP3k_6CO4o_Trj1A3nq97Cv7bKDCJlBo_cwXk M7J2zhpNa8TWQEKgaAymnuncWfXGl0cqpMWPzDe6LZLrObc66vlbLmCmzS.vVjq8mIJ2cL9FBHaV KiKZTAJ3WI.LR_5CKZXAqH80XMbM_DBrCjT6k5aPLfzFINryMvEmW9to7MOvQiy_TlTKojCMG3xJ eKFyKjFUs2zpNvZ7U46JppAZMPzU.6QA_win9sboynQtfkT6ogK69ykpFVmIh6tpqONHeTYrZVfK Q5hOcwwkUE9JOWXaRSnhtt7Mnd7q7grNgRY055m3ws0G8jH99iaYSMpKjcrLEJJsj03fkfL4jK2G HxGOI2Z.BulZJAOauS8xfK1icmo6VQjh20kFYBN40Ovegus.tvGkM8WGYxO3zHywm19D3FXm7ADd k1MyGpCng9qWj9Nm3 Received: from jws10715.mail.gq1.yahoo.com by sendmailws122.mail.gq1.yahoo.com; Mon, 08 Aug 2016 21:22:16 +0000; 1470691336.472 Date: Mon, 8 Aug 2016 21:21:27 +0000 (UTC) From: Spyros Kapnissis Reply-To: Spyros Kapnissis To: Lucene Users Message-ID: <240334400.14267196.1470691287094.JavaMail.yahoo@mail.yahoo.com> Subject: BooleanQuery rewrite optimization MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14267195_1314314742.1470691287093" References: <240334400.14267196.1470691287094.JavaMail.yahoo.ref@mail.yahoo.com> archived-at: Mon, 08 Aug 2016 21:22:35 -0000 ------=_Part_14267195_1314314742.1470691287093 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello all, I noticed while debugging a query that BooleanQuery will rewrite itself to = remove FILTER clauses that are also MUST as an optimization/simplification,= which makes total sense. So (+f:x #f:x) will become (+f:x). However, shouldn't there also be another optimization to remove FILTER clau= ses that are also SHOULD, while converting them to MUST? So, for eg. query = (f:x #f:x) will become (+f:x). I did an initial simple implementation and the tests seem to pass. Are ther= e any cases where this does not hold?=C2=A0 ------=_Part_14267195_1314314742.1470691287093--