# Sorted pagination in terms aggregation search

**URL:** <https://discuss.elastic.co/t/sorted-pagination-in-terms-aggregation-search/374820>\
**Category:** Elasticsearch\
**Tags:** aggregations\
**Created:** [February 20, 2025, 1:46pm UTC](https://discuss.elastic.co/t/sorted-pagination-in-terms-aggregation-search/374820 "2025-02-20T13:46:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian.dto](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@julian.dto](https://discuss.elastic.co/u/julian.dto)\
**Post date:** [February 20, 2025, 1:46pm UTC](https://discuss.elastic.co/t/sorted-pagination-in-terms-aggregation-search/374820/1 "2025-02-20T13:46:58Z")

</div>

Hello!

I am trying to run an aggregation search with pagination. The solutions I found were either partitioning or using search\_after.

With partitioning the sorting will only be inside of the partition, not the overall search.

and with search\_after I don't see how it would be possible to skip from page 1 to 5. It would always only be the next page as I need to know the key from the page before so the user could only switch to the next page, but never skip pages.

Is there any way to do an aggregation search with pagination where pages can be skipped and the order is kept throughout the pages?
