# A bug for the score calculation in Elastic Search

**URL:** <https://discuss.elastic.co/t/a-bug-for-the-score-calculation-in-elastic-search/101465>\
**Category:** Elasticsearch\
**Created:** [September 22, 2017, 9:54am UTC](https://discuss.elastic.co/t/a-bug-for-the-score-calculation-in-elastic-search/101465 "2017-09-22T09:54:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbickle](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@sbickle](https://discuss.elastic.co/u/sbickle)\
**Post date:** [September 22, 2017, 9:54am UTC](https://discuss.elastic.co/t/a-bug-for-the-score-calculation-in-elastic-search/101465/1 "2017-09-22T09:54:28Z")

</div>

Hi, Expert,

I just found one wired issue for the score of matching.

The message is like this:

GET /scenario/group\_2/1  
{  
"message" : "test search 1, 0",  
"score":8.201733  
}

After matching by phrase, i got:

"hits": {  
"total": 1,  
"max\_score": 3.9513056,  
"hits": [  
{  
"\_index": "scenario",  
"\_type": "group\_2",  
"\_id": "1",  
"\_score": 3.9513056,  
"\_source": {  
"message": "test search 1, 0",  
"score": 8.201733  
}

The score is 3.9513056.

But after i search with:

GET /scenario/\_search  
{  
"query" : {  
"match" : {  
"message" : "test search 1, **1**"  
}  
}  
}

Please note the latest number is 1. And the result is:

hits": {  
"total": 4,  
"max\_score": 4.5427876,  
"hits": [  
{  
"\_index": "scenario",  
"\_type": "group\_2",  
"\_id": "1",  
"\_score": **4.5427876** ,  
"\_source": {  
"message": "test search 1, 0",  
"score": 8.201733  
}  
},

The score is 4.5427876 which is higher than the one when match by phrase.

This does not make sense.

Please let me know the reason and how to avoid this.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 25, 2017, 8:50am UTC](https://discuss.elastic.co/t/a-bug-for-the-score-calculation-in-elastic-search/101465/2 "2017-09-25T08:50:41Z")

</div>

Can you provide the first query that produced the 3.9513056 score?

---

<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:** [October 23, 2017, 8:51am UTC](https://discuss.elastic.co/t/a-bug-for-the-score-calculation-in-elastic-search/101465/3 "2017-10-23T08:51:04Z")

</div>

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