# Nested aggregations number of results by aggregations

**URL:** <https://discuss.elastic.co/t/nested-aggregations-number-of-results-by-aggregations/56644>\
**Category:** Elasticsearch\
**Created:** [July 28, 2016, 3:13pm UTC](https://discuss.elastic.co/t/nested-aggregations-number-of-results-by-aggregations/56644 "2016-07-28T15:13:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [July 28, 2016, 3:13pm UTC](https://discuss.elastic.co/t/nested-aggregations-number-of-results-by-aggregations/56644/1 "2016-07-28T15:13:40Z")

</div>

Hi,

I have a question about the number of result by aggregations, for every aggregations I have always not more than 10 results.  
Following the request anthe results.

Request:  
{  
"from" : 0,  
"size": 15,  
"query": {  
"match": {  
"doc.full\_text\_search": {  
"query": "accompagnato como stefano",  
"operator": "or"  
}  
}  
},  
"aggs": {  
"group\_by\_anno": {  
"terms": {  
"field": "doc.uscita.anno"  
}  
},  
"group\_by\_testata": {  
"terms": {  
"field": "doc.testata.sigla"  
}  
},  
"group\_by\_categoria": {  
"terms": {  
"field": "doc.categoria.nome"  
}  
},  
"group\_by\_comune": {  
"terms": {  
"field": "doc.luogo.comune.nome"  
}  
}  
}  
}

Result:

{  
"took": 505,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 25946,  
"max\_score": 10.722082,  
"hits": [  
{  
"\_index": "netweek",  
"\_type": "articolo\_mapped",  
"\_id": "3816612",  
"\_score": 10.722082,  
"\_source": {  
"doc": {  
"art\_id": "3816612",  
...................................................  
}  
.....................................................

```
]

```

},  
"aggregations": {  
"group\_by\_testata": {  
"doc\_count\_error\_upper\_bound": 61,  
"sum\_other\_doc\_count": 15862,  
"buckets": [  
{  
"key": "GDL",  
"doc\_count": 1377  
},  
{  
"key": "GDE",  
"doc\_count": 1148  
},  
{  
"key": "GOC",  
"doc\_count": 1094  
},  
{  
"key": "SA7",  
"doc\_count": 1074  
},  
{  
"key": "GDS",  
"doc\_count": 1055  
},  
{  
"key": "VAL",  
"doc\_count": 990  
},  
{  
"key": "GDU",  
"doc\_count": 867  
},  
{  
"key": "GDO",  
"doc\_count": 860  
},  
{  
"key": "NOB",  
"doc\_count": 827  
},  
{  
"key": "PBI",  
"doc\_count": 792  
}  
]  
},  
"group\_by\_anno": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": 2015,  
"doc\_count": 12509  
},  
{  
"key": 2016,  
"doc\_count": 7584  
},  
{  
"key": 2014,  
"doc\_count": 5853  
}  
]  
},  
"group\_by\_comune": {  
"doc\_count\_error\_upper\_bound": 91,  
"sum\_other\_doc\_count": 20022,  
"buckets": [  
{  
"key": "Como",  
"doc\_count": 1208  
},  
{  
"key": "Lecco",  
"doc\_count": 688  
},  
{  
"key": "Erba",  
"doc\_count": 594  
},  
{  
"key": "Biella",  
"doc\_count": 577  
},  
{  
"key": "Aosta",  
"doc\_count": 568  
},  
{  
"key": "Rho",  
"doc\_count": 507  
},  
{  
"key": "Vercelli",  
"doc\_count": 492  
},  
{  
"key": "Seregno",  
"doc\_count": 438  
},  
{  
"key": "Monza",  
"doc\_count": 429  
},  
{  
"key": "Olgiate Comasco",  
"doc\_count": 423  
}  
]  
},  
"group\_by\_categoria": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 2835,  
"buckets": [  
{  
"key": "Cronaca",  
"doc\_count": 8058  
},  
{  
"key": "Tempo Libero e Cultura",  
"doc\_count": 5002  
},  
{  
"key": "Politica e amministrativa",  
"doc\_count": 2749  
},  
{  
"key": "Sport - Calcio",  
"doc\_count": 2437  
},  
{  
"key": "Cronaca Nera e Giudiziaria",  
"doc\_count": 1584  
},  
{  
"key": "Sport - ..altri sport",  
"doc\_count": 1021  
},  
{  
"key": "Sport - Basket",  
"doc\_count": 647  
},  
{  
"key": "Lavoro Economia",  
"doc\_count": 544  
},  
{  
"key": "Sport",  
"doc\_count": 544  
},  
{  
"key": "Scuola",  
"doc\_count": 525  
}  
]  
}  
}  
}

---

<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 5, 2017, 10:32pm UTC](https://discuss.elastic.co/t/nested-aggregations-number-of-results-by-aggregations/56644/2 "2017-07-05T22:32:01Z")

</div>


