# Paginating result set greater than 10000 (with aggregations) - Possible options

**URL:** <https://discuss.elastic.co/t/paginating-result-set-greater-than-10000-with-aggregations-possible-options/119673>\
**Category:** Elasticsearch\
**Created:** [February 13, 2018, 4:11pm UTC](https://discuss.elastic.co/t/paginating-result-set-greater-than-10000-with-aggregations-possible-options/119673 "2018-02-13T16:11:16Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [February 21, 2018, 2:50pm UTC](https://discuss.elastic.co/t/paginating-result-set-greater-than-10000-with-aggregations-possible-options/119673/5 "2018-02-21T14:50:32Z")

</div>

> I am trying to cover up the use case wherein a user does take the pain of navigating to 501th page!

I see. So no search here. You are basically searching with a match\_all query and you only have a filter by category, right?

I believe you have few choices here:

- Blocking the user after page 500 explaining that he should refine its search.
- Increasing the default value `index.max_result_window` but as you know already this comes with a cost. Also the deeper you go, the slower it will be
- Unless you use search\_after feature where elasticsearch can do some optimizations but you can't really go back IMO.
- scroll might be something to consider but it has some drawbacks: keeping segments around until all scrolls has been released, if the user take too much time on a page before scrolling again he will loose the scroll id and will restart, aggs: you need to keep them somewhere in your app layer, going back is not allowed either.

Redesigning the result page might be a better choice IMO but I don't know if it's doable in your context. I like the faceted navigation pattern which is used everywhere to help the user finding the best data for him without having to go 100s of pages.

My 0.05 cents

---

_[View the full topic](https://discuss.elastic.co/t/paginating-result-set-greater-than-10000-with-aggregations-possible-options/119673)._
