[ 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 the boolean query. 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. > 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 the boolean query. > public CustomScoreQuery(Query subQuery, FunctionQuery scoringQuery) { -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org