[ 
https://issues.apache.org/jira/browse/LUCENE-10537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17528541#comment-17528541
 ] 

Lu Xugang commented on LUCENE-10537:
------------------------------------

Thanks [~jpountz]  for your note.
{quote}we discussed that it's a bit of a degenerate case to create a 
DisjunctionMaxQuery in the first place if scores are not needed
{quote}
Agreed, the purpose of this issue was this `dsl` in Elasticsearch as below:
{code:java}
{
  "query": {
    "query_string": {
      "query": "9",
      "default_operator": "AND",
      "allow_leading_wildcard": true,
      "analyze_wildcard": false
    }
  },
  "sort": [
    {
      "@timestamp": {
        "order": "desc"
      }
    }
  ],
  "_source": true,
  "track_total_hits": true
}
{code}
When `sort` filed enables, score was disabled and DisjunctionMaxScorer was 
still used to do iteration. Since booleanQuery has much more optimizations, we 
could rewrite to booleanQuery in Weigth#createWeight.

Maybe us should optimize our dsl or this is a Elasticsearch's issue?

> DisjunctionMaxWeight could be rewrite to BooleanWeight if score is disable
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-10537
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10537
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Lu Xugang
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If scores are not needed, could we let BooleanWeight deal with optimizing 
> things?



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to