# The same query return different documents,why?

**URL:** https://discuss.elastic.co/t/the-same-query-return-different-documents-why/82828
**Category:** Elasticsearch
**Created:** [April 19, 2017, 7:03am UTC](https://discuss.elastic.co/t/the-same-query-return-different-documents-why/82828 "2017-04-19T07:03:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![254985319](https://avatars.discourse-cdn.com/v4/letter/2/898d66/32.png) [@254985319](https://discuss.elastic.co/u/254985319)
#### Post date: [April 19, 2017, 7:03am UTC](https://discuss.elastic.co/t/the-same-query-return-different-documents-why/82828/1 "2017-04-19T07:03:14Z")

</div>

**I send a request to the es cluster,and es return different score and document ,this is my query string:**  
{  
"query": {  
"bool": {  
"must": [  
{  
"term": {  
"shop\_id": 7966  
}  
}  
],  
"must\_not": [],  
"should": []  
}  
},  
"from": 0,  
"size": 1,  
"sort": [],  
"aggs": {},  
"explain": true  
}  
result1:  
{  
"took": 9,  
"timed\_out": false,  
"\_shards": {  
"total": 230,  
"successful": 230,  
"failed": 0  
},  
"hits": {  
"total": 177,  
"max\_score": 11.175269,  
"hits": [  
{  
"\_shard": 2,  
"\_node": "-pLUH7Y\_TZWgLuuTgaJq1Q",  
"\_id": "1649835",  
"\_score": 11.175269,  
"\_explanation": {  
"value": 11.175269,  
"description": "weight(shop\_id:`\> in 20) [PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 11.175269,  
"description": "fieldWeight in 20, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0",  
"details": []  
}  
]  
}  
,  
{  
"value": 11.175269,  
"description": "idf(docFreq=25, maxDocs=682396)",  
"details": []  
}  
,  
{  
"value": 1,  
"description": "fieldNorm(doc=20)",  
"details": []  
}  
]  
}  
]  
}  
}  
]  
}  
}

result2:

{  
"took": 7,  
"timed\_out": false,  
"\_shards": {  
"total": 230,  
"successful": 230,  
"failed": 0  
},  
"hits": {  
"total": 177,  
"max\_score": 11.147332,  
"hits": [  
{  
"\_shard": 2,  
"\_node": "kJSNzpFiRXi1ui-cOu23Jw",  
"\_id": "1661990",  
"\_score": 11.147332,  
"\_explanation": {  
"value": 11.147332,  
"description": "weight(shop\_id:`\> in 82900) [PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 11.147332,  
"description": "fieldWeight in 82900, product of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0",  
"details": []  
}  
]  
}  
,  
{  
"value": 11.147332,  
"description": "idf(docFreq=25, maxDocs=663596)",  
"details": []  
}  
,  
{  
"value": 1,  
"description": "fieldNorm(doc=82900)",  
"details": []  
}  
]  
}  
]  
}  
}  
]  
}  
}

why not the document is different?

---

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [April 19, 2017, 9:57am UTC](https://discuss.elastic.co/t/the-same-query-return-different-documents-why/82828/2 "2017-04-19T09:57:07Z")

</div>

Does your cluster green ? Can you format the Json plz ?

---

<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: [May 17, 2017, 10:10am UTC](https://discuss.elastic.co/t/the-same-query-return-different-documents-why/82828/3 "2017-05-17T10:10:43Z")

</div>

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