# How is it calculated \_score

**URL:** <https://discuss.elastic.co/t/how-is-it-calculated--score/20469>\
**Category:** Elasticsearch\
**Created:** [October 28, 2014, 7:38pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469 "2014-10-28T19:38:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Sciuto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manuel_sciuto/32/1111_2.png) [@Manuel\_Sciuto](https://discuss.elastic.co/u/Manuel_Sciuto)\
**Post date:** [October 28, 2014, 7:38pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/1 "2014-10-28T19:38:03Z")

</div>

Hello

How is score calculated?

GET /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
{  
"query": {  
"filtered": {  
"query": {  
"match": {  
"name": "Sheraton"  
}  
}  
}  
}  
}

Response

{  
"took": 4,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 506,  
"max\_score": 6.8087983,  
"hits": [  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "273825",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "252355",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "132774",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "225509",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "232124",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "219172",  
\* "\_score": 6.8087983,\*  
"\_source": {  
"name": "Sheraton",  
"reviews": 0  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "224180",  
\* "\_score": 6.7636743,\*  
"\_source": {  
"name": "Sheraton",  
"reviews": 3  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "268979",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 12  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "228353",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
}  
},  
{  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "112508",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 9  
}  
}  
]  
}  
}

Because the score is different in some cases? If the name is the same

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/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%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:** [October 28, 2014, 7:47pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/2 "2014-10-28T19:47:49Z")

</div>

The default scoring algorithm is based on TF-IDF.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

You can enable explain to see how documents are scored:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Without knowing more about your system, I suspect it is the IDF that is  
causing the mismatch. The IDF is calculated per shard, so if when your  
documents come from different shards, the scores can be different. Try  
using a distributed search type (dfs\_query\_then\_fetch) to see if the issue  
still persists:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Tue, Oct 28, 2014 at 3:38 PM, Manuel Sciuto [msciuto@viajeros.com](mailto:msciuto@viajeros.com) wrote:

> Hello
> 
> How is score calculated?
> 
> GET /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
> {  
> "query": {  
> "filtered": {  
> "query": {  
> "match": {  
> "name": "Sheraton"  
> }  
> }  
> }  
> }  
> }
> 
> Response
> 
> {  
> "took": 4,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 506,  
> "max\_score": 6.8087983,  
> "hits": [  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "273825",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "252355",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "132774",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "225509",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "232124",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "219172",  
> \* "\_score": 6.8087983,\*  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 0  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "224180",  
> \* "\_score": 6.7636743,\*  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 3  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "268979",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 12  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "228353",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "112508",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 9  
> }  
> }  
> ]  
> }  
> }
> 
> Because the score is different in some cases? If the name is the same
> 
> 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/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%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%3DcQCmXPjzLqmz\_J8%3DKHYDHOM92yX5EVj1CePWCzW%3DMkmYuA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCmXPjzLqmz_J8%3DKHYDHOM92yX5EVj1CePWCzW%3DMkmYuA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Manuel\_Sciuto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manuel_sciuto/32/1111_2.png) [@Manuel\_Sciuto](https://discuss.elastic.co/u/Manuel_Sciuto)\
**Post date:** [October 28, 2014, 8:44pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/3 "2014-10-28T20:44:48Z")

</div>

Request  
GET /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
{  
"explain": true,  
"query": {  
"filtered": {  
"query": {  
"match": {  
"name": "Sheraton"  
}  
}  
}  
}  
}

Response

{  
"took": 106,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 506,  
"max\_score": 6.8087983,  
"hits": [  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "273825",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 5198)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 5198, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=5198)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "252355",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 19220)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 19220, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=19220)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "132774",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 21640)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 21640, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=21640)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "225509",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 22144)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 22144, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=22144)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "232124",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 1  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 22498)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 22498, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=22498)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 1,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "219172",  
"\_score": 6.8087983,  
"\_source": {  
"name": "Sheraton",  
"reviews": 0  
},  
"\_explanation": {  
"value": 6.8087983,  
"description": "weight(name:sheraton in 1368)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.8087983,  
"description": "fieldWeight in 1368, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=1368)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 4,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "224180",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 3  
},  
"\_explanation": {  
"value": 6.7636743,  
"description": "weight(name:sheraton in 744)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.7636743,  
"description": "fieldWeight in 744, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.7636743,  
"description": "idf(docFreq=90, maxDocs=28985)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=744)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 4,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "268979",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 12  
},  
"\_explanation": {  
"value": 6.7636743,  
"description": "weight(name:sheraton in 15584)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.7636743,  
"description": "fieldWeight in 15584, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.7636743,  
"description": "idf(docFreq=90, maxDocs=28985)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=15584)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 4,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "228353",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 2  
},  
"\_explanation": {  
"value": 6.7636743,  
"description": "weight(name:sheraton in 22863)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.7636743,  
"description": "fieldWeight in 22863, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.7636743,  
"description": "idf(docFreq=90, maxDocs=28985)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=22863)"  
}  
]  
}  
]  
}  
},  
{  
"\_shard": 4,  
"\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
"\_index": "business",  
"\_type": "alojamiento",  
"\_id": "112508",  
"\_score": 6.7636743,  
"\_source": {  
"name": "Sheraton",  
"reviews": 9  
},  
"\_explanation": {  
"value": 6.7636743,  
"description": "weight(name:sheraton in 24214)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 6.7636743,  
"description": "fieldWeight in 24214, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 6.7636743,  
"description": "idf(docFreq=90, maxDocs=28985)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=24214)"  
}  
]  
}  
]  
}  
}  
]  
}  
}

El martes, 28 de octubre de 2014 16:47:56 UTC-3, Ivan Brusic escribió:

> The default scoring algorithm is based on TF-IDF.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/practical-scoring-function.html)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scoring-theory.html)
> 
> You can enable explain to see how documents are scored:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html)
> 
> Without knowing more about your system, I suspect it is the IDF that is  
> causing the mismatch. The IDF is calculated per shard, so if when your  
> documents come from different shards, the scores can be different. Try  
> using a distributed search type (dfs\_query\_then\_fetch) to see if the issue  
> still persists:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_search_options.html#search-type)
> 
> Cheers,
> 
> Ivan
> 
> On Tue, Oct 28, 2014 at 3:38 PM, Manuel Sciuto \<[msc...@viajeros.com](mailto:msc...@viajeros.com)  
> \<javascript:\>\> wrote:
> 
> > Hello
> > 
> > How is score calculated?
> > 
> > GET  
> > /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
> > {  
> > "query": {  
> > "filtered": {  
> > "query": {  
> > "match": {  
> > "name": "Sheraton"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > Response
> > 
> > {  
> > "took": 4,  
> > "timed\_out": false,  
> > "\_shards": {  
> > "total": 5,  
> > "successful": 5,  
> > "failed": 0  
> > },  
> > "hits": {  
> > "total": 506,  
> > "max\_score": 6.8087983,  
> > "hits": [  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "273825",  
> > "\_score": 6.8087983,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 2  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "252355",  
> > "\_score": 6.8087983,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 1  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "132774",  
> > "\_score": 6.8087983,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 1  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "225509",  
> > "\_score": 6.8087983,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 2  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "232124",  
> > "\_score": 6.8087983,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 1  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "219172",  
> > \* "\_score": 6.8087983,\*  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 0  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "224180",  
> > \* "\_score": 6.7636743,\*  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 3  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "268979",  
> > "\_score": 6.7636743,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 12  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "228353",  
> > "\_score": 6.7636743,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 2  
> > }  
> > },  
> > {  
> > "\_index": "business",  
> > "\_type": "alojamiento",  
> > "\_id": "112508",  
> > "\_score": 6.7636743,  
> > "\_source": {  
> > "name": "Sheraton",  
> > "reviews": 9  
> > }  
> > }  
> > ]  
> > }  
> > }
> > 
> > Because the score is different in some cases? If the name is the same
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%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/7f9cd140-e096-4a49-811d-482f212243d4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f9cd140-e096-4a49-811d-482f212243d4%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:** [October 28, 2014, 8:57pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/4 "2014-10-28T20:57:06Z")

</div>

As predicted, your IDF values differ. Shard 1 has fewer documents than  
shard 4 with that term make the shard 1 documents more relevant. You can  
change the search type as described above.

{  
"value": 6.8087983,  
"description": "idf(docFreq=86, maxDocs=28990)"  
},

{  
"value": 6.7636743,  
"description": "idf(docFreq=90, maxDocs=28985)"  
},

--  
Ivan

On Tue, Oct 28, 2014 at 4:44 PM, Manuel Sciuto [msciuto@viajeros.com](mailto:msciuto@viajeros.com) wrote:

> Request  
> GET /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
> {  
> "explain": true,  
> "query": {  
> "filtered": {  
> "query": {  
> "match": {  
> "name": "Sheraton"  
> }  
> }  
> }  
> }  
> }
> 
> Response
> 
> {  
> "took": 106,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 506,  
> "max\_score": 6.8087983,  
> "hits": [  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "273825",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 5198)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 5198, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=5198)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "252355",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 19220)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 19220, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=19220)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "132774",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 21640)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 21640, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=21640)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "225509",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 22144)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 22144, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=22144)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "232124",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 22498)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 22498, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=22498)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 1,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "219172",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 0  
> },  
> "\_explanation": {  
> "value": 6.8087983,  
> "description": "weight(name:sheraton in 1368)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.8087983,  
> "description": "fieldWeight in 1368, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.8087983,  
> "description": "idf(docFreq=86, maxDocs=28990)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=1368)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 4,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "224180",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 3  
> },  
> "\_explanation": {  
> "value": 6.7636743,  
> "description": "weight(name:sheraton in 744)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.7636743,  
> "description": "fieldWeight in 744, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.7636743,  
> "description": "idf(docFreq=90, maxDocs=28985)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=744)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 4,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "268979",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 12  
> },  
> "\_explanation": {  
> "value": 6.7636743,  
> "description": "weight(name:sheraton in 15584)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.7636743,  
> "description": "fieldWeight in 15584, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.7636743,  
> "description": "idf(docFreq=90, maxDocs=28985)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=15584)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 4,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "228353",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> },  
> "\_explanation": {  
> "value": 6.7636743,  
> "description": "weight(name:sheraton in 22863)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.7636743,  
> "description": "fieldWeight in 22863, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.7636743,  
> "description": "idf(docFreq=90, maxDocs=28985)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=22863)"  
> }  
> ]  
> }  
> ]  
> }  
> },  
> {  
> "\_shard": 4,  
> "\_node": "6MdK3cvjRQyqaaiUkxjIZQ",  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "112508",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 9  
> },  
> "\_explanation": {  
> "value": 6.7636743,  
> "description": "weight(name:sheraton in 24214)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 6.7636743,  
> "description": "fieldWeight in 24214, product of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 6.7636743,  
> "description": "idf(docFreq=90, maxDocs=28985)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=24214)"  
> }  
> ]  
> }  
> ]  
> }  
> }  
> ]  
> }  
> }
> 
> El martes, 28 de octubre de 2014 16:47:56 UTC-3, Ivan Brusic escribió:
> 
> > The default scoring algorithm is based on TF-IDF.
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/)  
> > current/practical-scoring-function.html  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/)  
> > current/scoring-theory.html
> > 
> > You can enable explain to see how documents are scored:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > reference/current/search-request-explain.html
> > 
> > Without knowing more about your system, I suspect it is the IDF that is  
> > causing the mismatch. The IDF is calculated per shard, so if when your  
> > documents come from different shards, the scores can be different. Try  
> > using a distributed search type (dfs\_query\_then\_fetch) to see if the issue  
> > still persists:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/)  
> > current/\_search\_options.html#search-type
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Tue, Oct 28, 2014 at 3:38 PM, Manuel Sciuto [msc...@viajeros.com](mailto:msc...@viajeros.com)  
> > wrote:
> > 
> > > Hello
> > > 
> > > How is score calculated?
> > > 
> > > GET /business/actividades,alojamiento,comida,transporte\_  
> > > &\_servicios/\_search  
> > > {  
> > > "query": {  
> > > "filtered": {  
> > > "query": {  
> > > "match": {  
> > > "name": "Sheraton"  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > Response
> > > 
> > > {  
> > > "took": 4,  
> > > "timed\_out": false,  
> > > "\_shards": {  
> > > "total": 5,  
> > > "successful": 5,  
> > > "failed": 0  
> > > },  
> > > "hits": {  
> > > "total": 506,  
> > > "max\_score": 6.8087983,  
> > > "hits": [  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "273825",  
> > > "\_score": 6.8087983,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 2  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "252355",  
> > > "\_score": 6.8087983,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 1  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "132774",  
> > > "\_score": 6.8087983,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 1  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "225509",  
> > > "\_score": 6.8087983,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 2  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "232124",  
> > > "\_score": 6.8087983,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 1  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "219172",  
> > > \* "\_score": 6.8087983,\*  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 0  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "224180",  
> > > \* "\_score": 6.7636743,\*  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 3  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "268979",  
> > > "\_score": 6.7636743,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 12  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "228353",  
> > > "\_score": 6.7636743,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 2  
> > > }  
> > > },  
> > > {  
> > > "\_index": "business",  
> > > "\_type": "alojamiento",  
> > > "\_id": "112508",  
> > > "\_score": 6.7636743,  
> > > "\_source": {  
> > > "name": "Sheraton",  
> > > "reviews": 9  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }
> > > 
> > > Because the score is different in some cases? If the name is the same
> > > 
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bcaf4e31-f64a-4cc7-8b2f-986212216b9c%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/7f9cd140-e096-4a49-811d-482f212243d4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f9cd140-e096-4a49-811d-482f212243d4%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/7f9cd140-e096-4a49-811d-482f212243d4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7f9cd140-e096-4a49-811d-482f212243d4%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%3DcQArNDx9SWDYfxHiDQy\_7t\_gXQS9BkMHQTmuVp\_FuwtueQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQArNDx9SWDYfxHiDQy_7t_gXQS9BkMHQTmuVp_FuwtueQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Manuel\_Sciuto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manuel_sciuto/32/1111_2.png) [@Manuel\_Sciuto](https://discuss.elastic.co/u/Manuel_Sciuto)\
**Post date:** [October 29, 2014, 4:25pm UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/5 "2014-10-29T16:25:44Z")

</div>

Thank you very much !!!

El martes, 28 de octubre de 2014 16:38:03 UTC-3, Manuel Sciuto escribió:

> Hello
> 
> How is score calculated?
> 
> GET /business/actividades,alojamiento,comida,transporte\_&\_servicios/\_search  
> {  
> "query": {  
> "filtered": {  
> "query": {  
> "match": {  
> "name": "Sheraton"  
> }  
> }  
> }  
> }  
> }
> 
> Response
> 
> {  
> "took": 4,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 506,  
> "max\_score": 6.8087983,  
> "hits": [  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "273825",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "252355",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "132774",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "225509",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "232124",  
> "\_score": 6.8087983,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 1  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "219172",  
> \* "\_score": 6.8087983,\*  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 0  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "224180",  
> \* "\_score": 6.7636743,\*  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 3  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "268979",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 12  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "228353",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 2  
> }  
> },  
> {  
> "\_index": "business",  
> "\_type": "alojamiento",  
> "\_id": "112508",  
> "\_score": 6.7636743,  
> "\_source": {  
> "name": "Sheraton",  
> "reviews": 9  
> }  
> }  
> ]  
> }  
> }
> 
> Because the score is different in some cases? If the name is the same
> 
> 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/91cdc162-78e1-4e0f-bc2f-aebf57e6a2f5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91cdc162-78e1-4e0f-bc2f-aebf57e6a2f5%40googlegroups.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, 12:53am UTC](https://discuss.elastic.co/t/how-is-it-calculated--score/20469/6 "2017-07-06T00:53:09Z")

</div>


