Can i use _score in sort with script?


(ganlinhao) #1

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"
}
}
}


(Jack Conradson) #2

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


(system) closed #3

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