# Why did the same text get different \_score?

**URL:** <https://discuss.elastic.co/t/why-did-the-same-text-get-different--score/78192>\
**Category:** Elasticsearch\
**Created:** [March 11, 2017, 3:17am UTC](https://discuss.elastic.co/t/why-did-the-same-text-get-different--score/78192 "2017-03-11T03:17:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![watson](https://avatars.discourse-cdn.com/v4/letter/w/ce73a5/32.png) [@watson](https://discuss.elastic.co/u/watson)\
**Post date:** [March 11, 2017, 3:17am UTC](https://discuss.elastic.co/t/why-did-the-same-text-get-different--score/78192/1 "2017-03-11T03:17:39Z")

</div>

\*\*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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 8, 2017, 3:17am UTC](https://discuss.elastic.co/t/why-did-the-same-text-get-different--score/78192/2 "2017-04-08T03:17:51Z")

</div>

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