# Unable to retrieve more 10k records from elastic search using rest api

**URL:** <https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051>\
**Category:** Elasticsearch\
**Created:** [September 24, 2021, 6:21am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051 "2021-09-24T06:21:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magesh\_02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magesh_02/32/94023_2.png) [@Magesh\_02](https://discuss.elastic.co/u/Magesh_02)\
**Post date:** [September 24, 2021, 6:21am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051/1 "2021-09-24T06:21:21Z")

</div>

I'm trying to get more than 10k records from an Elasticsearch using the Rest api ([http://localhost:9200/json-metrics/\_search](http://localhost:9200/json-metrics/_search)), but all I have is the rest api link, which is the input to my BI tool. I need those records in single url link. how to use the Rest API to get more than 10,000 records

---

<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:** [September 24, 2021, 6:39am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051/2 "2021-09-24T06:39:19Z")

</div>

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. (Not recommended anymore)

---

<div class="post-metadata">

**Author:** ![Magesh\_02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magesh_02/32/94023_2.png) [@Magesh\_02](https://discuss.elastic.co/u/Magesh_02)\
**Post date:** [September 24, 2021, 6:48am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051/3 "2021-09-24T06:48:12Z")

</div>

@dadoonet  
im new to elk, may be where to set the cofiguration index.max\_result\_window , any example for this

im using Nest

---

<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:** [September 24, 2021, 7:11am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051/4 "2021-09-24T07:11:50Z")

</div>

As I wrote, it's probably a bad idea.

> but be aware of the consequences (ie memory).

`index.max_result_window` is an index setting. So you set it when you create the index. I think you can update this setting on an existing index. [Update index settings API | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html)

---

<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:** [October 22, 2021, 7:12am UTC](https://discuss.elastic.co/t/unable-to-retrieve-more-10k-records-from-elastic-search-using-rest-api/285051/5 "2021-10-22T07:12:46Z")

</div>

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