# Wrong Scoring using match query on Sense

**URL:** <https://discuss.elastic.co/t/wrong-scoring-using-match-query-on-sense/18411>\
**Category:** Elasticsearch\
**Created:** [July 1, 2014, 8:43am UTC](https://discuss.elastic.co/t/wrong-scoring-using-match-query-on-sense/18411 "2014-07-01T08:43:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rayman\_2](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@rayman\_2](https://discuss.elastic.co/u/rayman_2)\
**Post date:** [July 1, 2014, 8:43am UTC](https://discuss.elastic.co/t/wrong-scoring-using-match-query-on-sense/18411/1 "2014-07-01T08:43:10Z")

</div>

I am trying to exercise the following example using Sense  
: [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/match-query.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/match-query.html).

However when I ran

GET /my\_index/my\_type/\_search  
{  
"query": {  
"match": {  
"title": "QUICK!"  
}  
}  
}

I got wrong scoring. I expect to see doc with is 3. But doc with id got  
higher score. any idea?:

{  
"took": 2,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 3,  
"max\_score": 0.5,  
"hits": [  
{  
"\_index": "my\_index",  
"\_type": "my\_type",  
"\_id": "1",  
"\_score": 0.5,  
"\_source": {  
"title": "The quick brown fox"  
}  
},  
{  
"\_index": "my\_index",  
"\_type": "my\_type",  
"\_id": "3",  
"\_score": 0.44194174,  
"\_source": {  
"title": "The quick brown fox jumps over the quick dog"  
}  
},  
{  
"\_index": "my\_index",  
"\_type": "my\_type",  
"\_id": "2",  
"\_score": 0.3125,  
"\_source": {  
"title": "The quick brown fox jumps over the lazy dog"  
}  
}  
]  
}  
}

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 2, 2014, 5:09pm UTC](https://discuss.elastic.co/t/wrong-scoring-using-match-query-on-sense/18411/2 "2014-07-02T17:09:08Z")

</div>

If you enable explanations, you would see that length normalization is  
scoring the document with the shorter field higher than the document with a  
term frequency of 2.

The fieldNorm is incredibly lossy since it uses only 1 byte, so there must  
be some inconsistencies between the example and your test case. The example  
has a fieldNorm of 0.375, while it is 0.3125 in your case (and mine as  
well). The example might not have deleted all the documents in the index  
before the test.

Cheers,

Ivan

On Tue, Jul 1, 2014 at 1:43 AM, rayman [idan.frid@gmail.com](mailto:idan.frid@gmail.com) wrote:

> I am trying to exercise the following example using Sense :  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/match-query.html)  
> .
> 
> However when I ran
> 
> GET /my\_index/my\_type/\_search  
> {  
> "query": {  
> "match": {  
> "title": "QUICK!"  
> }  
> }  
> }
> 
> I got wrong scoring. I expect to see doc with is 3. But doc with id got  
> higher score. any idea?:
> 
> {  
> "took": 2,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 1,  
> "successful": 1,  
> "failed": 0  
> },  
> "hits": {  
> "total": 3,  
> "max\_score": 0.5,  
> "hits": [  
> {  
> "\_index": "my\_index",  
> "\_type": "my\_type",  
> "\_id": "1",  
> "\_score": 0.5,  
> "\_source": {  
> "title": "The quick brown fox"  
> }  
> },  
> {  
> "\_index": "my\_index",  
> "\_type": "my\_type",  
> "\_id": "3",  
> "\_score": 0.44194174,  
> "\_source": {  
> "title": "The quick brown fox jumps over the quick dog"  
> }  
> },  
> {  
> "\_index": "my\_index",  
> "\_type": "my\_type",  
> "\_id": "2",  
> "\_score": 0.3125,  
> "\_source": {  
> "title": "The quick brown fox jumps over the lazy dog"  
> }  
> }  
> ]  
> }  
> }
> 
> Thanks.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAdM%3Dx6WfpbGVLRqiuVkF7QLXq0hZgCpqSSnc8A8nqHGQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAdM%3Dx6WfpbGVLRqiuVkF7QLXq0hZgCpqSSnc8A8nqHGQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:18am UTC](https://discuss.elastic.co/t/wrong-scoring-using-match-query-on-sense/18411/3 "2017-07-06T01:18:19Z")

</div>

Closed on July 6, 2017, 1:18am UTC


