# Way to get all documents more than 10,000,000

**URL:** https://discuss.elastic.co/t/way-to-get-all-documents-more-than-10-000-000/302079
**Category:** Elasticsearch
**Created:** [April 11, 2022, 8:52am UTC](https://discuss.elastic.co/t/way-to-get-all-documents-more-than-10-000-000/302079 "2022-04-11T08:52:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BonoHubby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bonohubby/32/104225_2.png) [@BonoHubby](https://discuss.elastic.co/u/BonoHubby)
#### Post date: [April 11, 2022, 8:52am UTC](https://discuss.elastic.co/t/way-to-get-all-documents-more-than-10-000-000/302079/1 "2022-04-11T08:52:43Z")

</div>

Dears, I want to get all docuemnts in an index.  
I already know the way but there was a limitation.

### Way to get documents more than 10,000.

- ES supprt size prametter. But the maximum value is 10,000.
- So to get more than 10,000 documents, Need use `sort` with `search_after`. Can navigate page.  
[Paginate search results | Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html)

## Limitation

My index has over 10,000,000 documents.  
First time, above way worked. But when I kept navigating another page. I got memory full errors. And can't use ES anymore.

Is there other efficient way? I think sort use lots of memory.  
I have to get all huge documents from index..

Thank you very much

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [April 11, 2022, 2:04pm UTC](https://discuss.elastic.co/t/way-to-get-all-documents-more-than-10-000-000/302079/2 "2022-04-11T14:04:11Z")

</div>

How many documents do you need to retrieve per pagination?

---

<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: [May 9, 2022, 2:04pm UTC](https://discuss.elastic.co/t/way-to-get-all-documents-more-than-10-000-000/302079/3 "2022-05-09T14:04:48Z")

</div>

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