**Elasticsearch version2.3.3:
Plugins installed: [head,ik]
**JVM versionopenjdk version "1.8.0_111":
**OS versionCentOS release 6.8 (Final):
my request:
{
"track_scores" : "true",
"sort" : {
"_script" : {
"type" : "number",
"script" : "_score+(doc.pi.value/200.0)",
"order" : "desc"
}
},
"query" : {
"match_phrase" : { "mediaName" : "微美食" }
}
}'
expect result:
{
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MzA5NTgyOTUyNA==",
"_score" : 17.916512,
"_source" : {
"mediaName" : "微美食",
"pmid" : "MzA5NTgyOTUyNA==",
"mediaNameLen" : 3,
"mediaScore" : 2.2,
"pi" : 600
},
"sort" : [ 23.91651153564453 ]
}, {
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MjM5NzMxOTM4MQ==",
"_score" : 17.916512,
"_source" : {
"mediaName" : "微美食",
"pmid" : "MjM5NzMxOTM4MQ==",
"mediaNameLen" : 3,
"mediaScore" : 2.062,
"pi" : 506
},
"sort" : [ 22.97651153564453 ]
}, {
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MjM5OTg0OTcwMg==",
"_score" : 17.916512,
"_source" : {
"mediaName" : "微美食西安",
"pmid" : "MjM5OTg0OTcwMg==",
"mediaNameLen" : 5,
"mediaScore" : 2.308,
"pi" : 629
},
"sort" : [ 24.20651153564453 ]
},
actual result with explain:
{
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MjM5OTg0OTcwMg==",
"_score" : 17.928457,
"_source" : {
"mediaName" : "微美食西安",
"pmid" : "MjM5OTg0OTcwMg==",
"mediaNameLen" : 5,
"mediaScore" : 2.308,
"pi" : 629
},
"sort" : [ 21.073457260131836 ]
}, {
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MzA5NTgyOTUyNA==",
"_score" : 17.817488,
"_source" : {
"mediaName" : "微美食",
"pmid" : "MzA5NTgyOTUyNA==",
"mediaNameLen" : 3,
"mediaScore" : 2.2,
"pi" : 600
},
"sort" : [ 20.817487716674805 ]
}, {
"_index" : "media_b",
"_type" : "weixinMedia",
"_id" : "MjM5NzMxOTM4MQ==",
"_score" : 17.928457,
"_source" : {
"mediaName" : "微美食",
"pmid" : "MjM5NzMxOTM4MQ==",
"mediaNameLen" : 3,
"mediaScore" : 2.062,
"pi" : 506
},
"sort" : [ 20.458457260131837 ]
},
I don't know why the same word with different _score and the first one is not precise matching.Did I have some error or the plugin of ik is not precision?
thanks!