Sort by _score error in es5.1.1

I found that es5.1.1 can't sort by _score,the same query es2.x works but it throw:
No mapping found for [_score] in order to sort on
sort json:
"sort" : [
{
"_score" : {
"order" : "desc"
}
},
{
"memb_num" : {
"order" : "desc"
}
}
]

I was not able to reproduce your issue on a fresh install of ES 5.1.1 using the below script.

Could you paste the complete request you are sending, the response JSON you receive and the stack trace you'll get in your server logs for this? Also, is this a fresh install of ES 5.1.1 or have you upgraded it from 2.x?

Thanks

Colin

I‘m using the java api,and found that ’SortBuilders has new function call scoreSort,i use this solve the problem(original use fieldSort with "_score").

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