# Export all records from 12M index

**URL:** <https://discuss.elastic.co/t/export-all-records-from-12m-index/269221>\
**Category:** Elasticsearch\
**Created:** [April 5, 2021, 10:07am UTC](https://discuss.elastic.co/t/export-all-records-from-12m-index/269221 "2021-04-05T10:07:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YaronB](https://avatars.discourse-cdn.com/v4/letter/y/b4bc9f/32.png) [@YaronB](https://discuss.elastic.co/u/YaronB)\
**Post date:** [April 5, 2021, 10:07am UTC](https://discuss.elastic.co/t/export-all-records-from-12m-index/269221/1 "2021-04-05T10:07:13Z")

</div>

the problem is with the index.max\_result\_window,  
we have an index of 12M records , how can we query/get all data using a script?

(logstash not relevant)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 6, 2021, 1:09am UTC](https://discuss.elastic.co/t/export-all-records-from-12m-index/269221/2 "2021-04-06T01:09:14Z")

</div>

Use scan and scroll - [Scan and scroll | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.12/scan-scroll.html)

---

<div class="post-metadata">

**Author:** ![YaronB](https://avatars.discourse-cdn.com/v4/letter/y/b4bc9f/32.png) [@YaronB](https://discuss.elastic.co/u/YaronB)\
**Post date:** [April 6, 2021, 10:44am UTC](https://discuss.elastic.co/t/export-all-records-from-12m-index/269221/3 "2021-04-06T10:44:18Z")

</div>

We no longer recommend using the scroll API for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the [`search_after`](https://www.elastic.co/guide/en/elasticsearch/reference/7.12/paginate-search-results.html#search-after) parameter with a point in time (PIT).

---

<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 4, 2021, 10:44am UTC](https://discuss.elastic.co/t/export-all-records-from-12m-index/269221/4 "2021-05-04T10:44:25Z")

</div>

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