# Internal building of aggregations

**URL:** <https://discuss.elastic.co/t/internal-building-of-aggregations/105302>\
**Category:** Elasticsearch\
**Created:** [October 25, 2017, 9:34pm UTC](https://discuss.elastic.co/t/internal-building-of-aggregations/105302 "2017-10-25T21:34:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thampton](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@thampton](https://discuss.elastic.co/u/thampton)\
**Post date:** [October 25, 2017, 9:34pm UTC](https://discuss.elastic.co/t/internal-building-of-aggregations/105302/1 "2017-10-25T21:34:04Z")

</div>

How does Elasticsearch assemble the aggregations? During a search a list of hits are produced for each shard (if I'm understanding how it works). Are the hits for each shard aggregated at that time and then merged later, similar to how hits are merged by the coordinating node?

Thanks

---

<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:** [November 22, 2017, 9:34pm UTC](https://discuss.elastic.co/t/internal-building-of-aggregations/105302/2 "2017-11-22T21:34:35Z")

</div>

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