# Aggregation paging problem

**URL:** <https://discuss.elastic.co/t/aggregation-paging-problem/111674>\
**Category:** Elasticsearch\
**Created:** [December 14, 2017, 2:58am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674 "2017-12-14T02:58:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukekingbru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukekingbru/32/25254_2.png) [@lukekingbru](https://discuss.elastic.co/u/lukekingbru)\
**Post date:** [December 14, 2017, 2:58am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674/1 "2017-12-14T02:58:42Z")

</div>

My data set is very even distributed, the buckets is very large, how can we do the paging against the paging buckets ? For instance, the buckets size is 1000,000 ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 14, 2017, 6:25am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674/2 "2017-12-14T06:25:00Z")

</div>

And your user really needs to paginate over 1 000 000 buckets?  
I’m curious about the use case.

---

<div class="post-metadata">

**Author:** ![lukekingbru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukekingbru/32/25254_2.png) [@lukekingbru](https://discuss.elastic.co/u/lukekingbru)\
**Post date:** [December 14, 2017, 7:20am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674/3 "2017-12-14T07:20:46Z")

</div>

1M is just an example. I wonder do we have the mechanism to do paging against aggs buckets?

Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 14, 2017, 9:25am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674/4 "2017-12-14T09:25:51Z")

</div>

Paging of aggregations is not possible for a variety of reasons eg:

1. Aggregations are a nested tree not a single flat list so there would need to be multiple cursors
2. Distributed data makes efficient paging hard

However, there is a tool for breaking up analysis on high-cardinality fields into multiple requests which is [term-based partitioning](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions)

---

<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:** [January 11, 2018, 9:25am UTC](https://discuss.elastic.co/t/aggregation-paging-problem/111674/5 "2018-01-11T09:25:53Z")

</div>

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