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 9F530200B7D for ; Sat, 10 Sep 2016 19:17:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9DD8E160ABE; Sat, 10 Sep 2016 17:17:22 +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 E7747160AA5 for ; Sat, 10 Sep 2016 19:17:21 +0200 (CEST) Received: (qmail 25704 invoked by uid 500); 10 Sep 2016 17:17:20 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 25689 invoked by uid 99); 10 Sep 2016 17:17:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Sep 2016 17:17:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7CF8E2C0059 for ; Sat, 10 Sep 2016 17:17:20 +0000 (UTC) Date: Sat, 10 Sep 2016 17:17:20 +0000 (UTC) From: "Shayan Tabrizi (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LUCENE-7443) Enforcing BooleanClause.Occur.FILTER before CustomScoreQuery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 10 Sep 2016 17:17:22 -0000 [ https://issues.apache.org/jira/browse/LUCENE-7443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shayan Tabrizi updated LUCENE-7443: ----------------------------------- Description: I have a BooleanQuery including a BooleanClause.Occur.MUST clause and a BooleanClause.Occur.FILTER clause. I then use the BooleanQuery in a CustomScoreQuery. It seems that the filtering constraint is not enforced before calculating the score in CustomScoreQuery and is enforced after the calculation. This can cause performance issues, since CustomScoreQuery may perform costly operations to rescore the BooleanQuery results. If the filter is enforced before rescoring, much less documents may require rescoring in CustomScoreQuery, and it does not make sense to spend a lot of processing for documents we know will be filtered out. More details: The BooleanQuery is used as subQuery in the following constructor, and a costly scoringQuery is used which is more rational to calculate it only when the results of subQuery is not trivially filtered out because of the FILTER in subQuery. public CustomScoreQuery(Query subQuery, FunctionQuery scoringQuery) { was: I have a BooleanQuery including a BooleanClause.Occur.MUST clause and a BooleanClause.Occur.FILTER clause. I then use the BooleanQuery in a CustomScoreQuery. It seems that the filtering constraint is not enforced before calculating the score in CustomScoreQuery and is enforced after the calculation. This can cause performance issues, since CustomScoreQuery may perform costly operations to rescore the BooleanQuery results. If the filter is enforced before rescoring, much less documents may require rescoring in CustomScoreQuery, and it does not make sense to spend a lot of processing for documents we know will be filtered out. More details: The BooleanQuery is used as subQuery in the following constructor, and a costly scoringQuery is used which is more rational to calculate it only when the results of subQuery is not trivially filtered out because of the FILTER in the boolean query. public CustomScoreQuery(Query subQuery, FunctionQuery scoringQuery) { > Enforcing BooleanClause.Occur.FILTER before CustomScoreQuery > ------------------------------------------------------------ > > Key: LUCENE-7443 > URL: https://issues.apache.org/jira/browse/LUCENE-7443 > Project: Lucene - Core > Issue Type: Improvement > Affects Versions: 6.2 > Reporter: Shayan Tabrizi > Priority: Minor > > I have a BooleanQuery including a BooleanClause.Occur.MUST clause and a BooleanClause.Occur.FILTER clause. I then use the BooleanQuery in a CustomScoreQuery. It seems that the filtering constraint is not enforced before calculating the score in CustomScoreQuery and is enforced after the calculation. This can cause performance issues, since CustomScoreQuery may perform costly operations to rescore the BooleanQuery results. If the filter is enforced before rescoring, much less documents may require rescoring in CustomScoreQuery, and it does not make sense to spend a lot of processing for documents we know will be filtered out. > More details: > The BooleanQuery is used as subQuery in the following constructor, and a costly scoringQuery is used which is more rational to calculate it only when the results of subQuery is not trivially filtered out because of the FILTER in subQuery. > public CustomScoreQuery(Query subQuery, FunctionQuery scoringQuery) { -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org