# Pagenation over 10,000 documents

**URL:** https://discuss.elastic.co/t/pagenation-over-10-000-documents/258205
**Category:** Elasticsearch
**Created:** [December 10, 2020, 1:14am UTC](https://discuss.elastic.co/t/pagenation-over-10-000-documents/258205 "2020-12-10T01:14:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![innze](https://avatars.discourse-cdn.com/v4/letter/i/ccd318/32.png) [@innze](https://discuss.elastic.co/u/innze)
#### Post date: [December 10, 2020, 1:14am UTC](https://discuss.elastic.co/t/pagenation-over-10-000-documents/258205/1 "2020-12-10T01:14:59Z")

</div>

I'm implementing a pagenation with an ElasticSearch over 10,000 documents.  
It is possible to bring the search results before and after the search by after\_search.  
But I would like to create a function to bring from a specific point like from - to usage under 10,000 documents.

Is there any way I can refer to it?

Thanks

---

<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 10, 2020, 6:23am UTC](https://discuss.elastic.co/t/pagenation-over-10-000-documents/258205/2 "2020-12-10T06:23:20Z")

</div>

Not sure I understand the problem. If you have less than 10000 documents, you can use:

- the [`size` and `from` parameters](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) to display by default up to 10000 records to your users. If you want to change this limit, you can change `index.max_result_window` setting but be aware of the consequences (ie memory).
- the [search after](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html) feature to do deep pagination.
- the [Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) if you want to extract a resultset to be consumed by another tool later.

---

<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 7, 2021, 6:23am UTC](https://discuss.elastic.co/t/pagenation-over-10-000-documents/258205/3 "2021-01-07T06:23:27Z")

</div>

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