Skip to content

Script-score returning null values #24940

@clintongormley

Description

@clintongormley

Since the upgrade to Lucene 7 (#24089), the script-score function has been returning null values instead of the script return value:

curl -H'Content-type: application/json' -XPUT localhost:9200/t/t/1 -d'{}'

curl -H 'Content-Type: application/json' localhost:9200/_search?pretty -d '
{"sort": [
    {
      "_script": {
        "type": "number",
        "script": {
          "inline": "return 10.0",
          "lang": "painless"
        },
        "order": "desc"
      }
    }
  ]}'

returns:

  "hits" : {
    "total" : 1,
    "max_score" : null,
    "hits" : [
      {
        "_index" : "t",
        "_type" : "t",
        "_id" : "1",
        "_score" : null,
        "_source" : { },
        "sort" : [
          1.7976931348623157E308
        ]
      }
    ]
  }

Metadata

Metadata

Assignees

Labels

:Search/SearchSearch-related issues that do not fall into other categories>bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions