# Elasticsearch-dsl (6.2.1) aggs failed to return any buckers

**URL:** <https://discuss.elastic.co/t/elasticsearch-dsl-6-2-1-aggs-failed-to-return-any-buckers/147250>\
**Category:** Elasticsearch\
**Created:** [September 4, 2018, 6:24pm UTC](https://discuss.elastic.co/t/elasticsearch-dsl-6-2-1-aggs-failed-to-return-any-buckers/147250 "2018-09-04T18:24:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TwoDragon](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TwoDragon](https://discuss.elastic.co/u/TwoDragon)\
**Post date:** [September 4, 2018, 6:24pm UTC](https://discuss.elastic.co/t/elasticsearch-dsl-6-2-1-aggs-failed-to-return-any-buckers/147250/1 "2018-09-04T18:24:38Z")

</div>

Hi,  
The following search failed to return any results on a Elasticsearch 6.3.2 cluster  
rs = es.search(index="1234\_index", size=0,  
body={"query": { "bool": { "must": [{"match\_all": {}}] } },  
"aggs" : { "well\_groups": { "terms": { "field": "guid", "size": 10000},  
"aggs": { "max\_inc" : { "max" : { "field" : "Inc" } } }}}})  
buckets = rs['aggregations']['well\_groups']['buckets']  
where len(buckets) is zero.

However, the following query using Kibana (6.3.2) Dev Tools' Console returns correct results. Any idea what I have missed in the above search. Thanks.  
POST /1234\_index/\_search?size=0  
{  
"query":  
{ "bool": { "must": [{"match\_all": {}}] } },  
"aggs" :  
{ "well\_groups":  
{ "terms": { "field": "guid", "size":10000 },  
"aggs": { "max\_inc" : { "max" : { "field" : "Inc" } } }  
}  
}  
}

Results:  
{  
"took": 4,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"skipped": 0,  
"failed": 0  
},  
"hits": {  
"total": 389,  
"max\_score": 0,  
"hits": []  
},  
"aggregations": {  
"well\_groups": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "0092B884A1294405BB051D63A7FBAC47",  
"doc\_count": 79,  
"max\_inc": {  
"value": 0.8360127117052838  
}  
},  
{  
"key": "001BF64A233444D59F134DB19E31B1A2",  
"doc\_count": 75,  
"max\_inc": {  
"value": 0.5907939518000807  
}  
},  
{  
"key": "008F52BE62CA431BB90C8653215F36B7",  
"doc\_count": 74,  
"max\_inc": {  
"value": 0.505098285527159  
}  
},  
{  
"key": "0076ADF536AF40719E8DE12CBD6B0F98",  
"doc\_count": 55,  
"max\_inc": {  
"value": 0.46041785667610413  
}  
},  
{  
"key": "007EF2B5A4404B54BE488B04001B3E95",  
"doc\_count": 55,  
"max\_inc": {  
"value": 0.6017895260876447  
}  
},  
{  
"key": "007EF2B5A4404B54BE488B04001B3E11",  
"doc\_count": 37,  
"max\_inc": {  
"value": 0.4389503068765739  
}  
},  
{  
"key": "00204C615CF740499F4AFA5D72085C85",  
"doc\_count": 14,  
"max\_inc": {  
"value": 0.37960911230876665  
}  
}  
]  
}  
}  
}

---

<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 2, 2018, 6:24pm UTC](https://discuss.elastic.co/t/elasticsearch-dsl-6-2-1-aggs-failed-to-return-any-buckers/147250/2 "2018-10-02T18:24:46Z")

</div>

Closed on October 2, 2018, 6:24pm UTC

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