Sort by _score error in es5.1.1


(laigood) #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"
}
}
]


(Colin Goodheart-Smithe) #2

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


(laigood) #3

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").


(system) #4

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