Can i use _score in sort with script?

hi, i wanna use script in sort, but can i use _score like
GET /_search
{
"query" : {
"term" : { "user" : "kimchy" }
},
"sort" : {
"_script" : {
"type" : "number",
"script" : {
"lang": "painless",
"source": "_score/doc['field_name'].value"
},
"order" : "asc"
}
}
}

You should be able to. Are you receiving an error attempting to use that script?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.