# Composite aggregation - When to page

**URL:** <https://discuss.elastic.co/t/composite-aggregation-when-to-page/217342>\
**Category:** Elasticsearch\
**Created:** [January 31, 2020, 10:01am UTC](https://discuss.elastic.co/t/composite-aggregation-when-to-page/217342 "2020-01-31T10:01:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiouser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wiouser/32/45741_2.png) [@wiouser](https://discuss.elastic.co/u/wiouser)\
**Post date:** [January 31, 2020, 10:01am UTC](https://discuss.elastic.co/t/composite-aggregation-when-to-page/217342/1 "2020-01-31T10:01:57Z")

</div>

Hi,

I tried using composite aggregation and using terms value source.  
For me it looks like all the responses contain the `after_key`  
How to identify from the response to decide when to send the request for next page?

I could not find the information here  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html)

---

<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:** [February 28, 2020, 10:02am UTC](https://discuss.elastic.co/t/composite-aggregation-when-to-page/217342/2 "2020-02-28T10:02:02Z")

</div>

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