[ https://issues.apache.org/jira/browse/LUCENE-10469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507555#comment-17507555 ]
ASF subversion and git services commented on LUCENE-10469: ---------------------------------------------------------- Commit 5b522487ba8e0f1002b50a136817ca037aec9686 in lucene's branch refs/heads/branch_9_1 from Adrien Grand [ https://gitbox.apache.org/repos/asf?p=lucene.git;h=5b52248 ] LUCENE-10469: Fix score mode propagation in ConstantScoreQuery. (#750) > ConstantScoreQuery doesn't propagate its score mode correctly > ------------------------------------------------------------- > > Key: LUCENE-10469 > URL: https://issues.apache.org/jira/browse/LUCENE-10469 > Project: Lucene - Core > Issue Type: Task > Reporter: Adrien Grand > Priority: Minor > Fix For: 9.1 > > Time Spent: 10m > Remaining Estimate: 0h > > We just noticed a performance bug on Elasticsearch that if you issue a search > request sorted by field and the query is a MatchAllDocsQuery then everything > works as expected. > But if you change the query to be a MatchAllDocsQuery within a > ConstantScoreQuery then the query suddenly visits all matching documents. > This is due to the fact that ConstantScoreQuery always passes > COMPLETE_NO_SCORES to the inner weight, and thet the MatchAllDocsQuery's > optimized bulk scorer performs a brute-force for-loop over the documents to > score unless the score mode is not exhaustive. > The fix consists of making ConstantScoreQuery propagate a non-exhaustive > score mode to the inner weight when the score mode that is passed to the > ConstantScoreQuery is not exhaustive itself. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org