# Max size for getting data

**URL:** <https://discuss.elastic.co/t/max-size-for-getting-data/114851>\
**Category:** Elasticsearch\
**Created:** [January 10, 2018, 11:40am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851 "2018-01-10T11:40:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [January 10, 2018, 11:40am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/1 "2018-01-10T11:40:27Z")

</div>

Hi

What is the max size for getting data?

```
get /pupil/_search
{
      "from": 0,
      "size": 10000,
       "query":{
         "match_all": {}
        }                                           
}

```

I have more than 70000 data. But is showing

```
{
  "error": {
    "root_cause": [
      {
        "type": "query_phase_execution_exception",
        "reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "pupil",
        "node": "EjNcgN2HQWW6P42Wur-dxw",
        "reason": {
          "type": "query_phase_execution_exception",
          "reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."
        }
      }
    ]
  },
  "status": 500
}

```

How can I solve this issue?

Thanks  
Aneesh

---

<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:** [January 10, 2018, 11:51am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/2 "2018-01-10T11:51:41Z")

</div>

Use scroll API if you need to export data.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [January 11, 2018, 6:05am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/3 "2018-01-11T06:05:50Z")

</div>

Hi David Pilato

```
Unsuccessful low level call on POST: /pupil/pupil/_search
# Audit trail of this API call:
 - [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.0521511
# ServerError: ServerError: 500Type: search_phase_execution_exception Reason: "all shards failed"
# Request:

                                {
                                    "from": 0,
                                    "size": 100000,
                                    "query" : {
                                    "bool": {
                                                "must_not": [
                                                    {
                                                        "match": {
                                                            "_id": "null"
                                                                    }
                                                    },
                                                    {
                                                        "match": {
                                                            "_id": "-1"
                                                                    }
                                                    }
                                                    ,
                                                    {
                                                        "match": {
                                                            "_id": "lastmodified"
                                                                    }
                                                    }
                                                                ]
                                                }
                                            }
                                                                    
                                }
# Response:
{"error":{"root_cause":[{"type":"query_phase_execution_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"pupil","node":"EjNcgN2HQWW6P42Wur-dxw","reason":{"type":"query_phase_execution_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."}}]},"status":500}

```

Nest Query is giving error. Scroll API will help in this?

Thanks  
Aneesh L

---

<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:** [January 11, 2018, 6:50am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/4 "2018-01-11T06:50:19Z")

</div>

It's all written in the error

> See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max\_result\_window] index level setting.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [January 11, 2018, 12:31pm UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/5 "2018-01-11T12:31:56Z")

</div>

Hi David Pilato

I changed settings, It worked

Thanks  
Aneesh

---

<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:** [January 11, 2018, 2:55pm UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/6 "2018-01-11T14:55:46Z")

</div>

I hope you understand the consequences of changing settings.  
Specifically in term of memory pressure.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [January 12, 2018, 3:47am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/7 "2018-01-12T03:47:23Z")

</div>

Hi David Pilato

I need to get 100000 records. Is there any other solution for getting big data, without changing index settings.

Thanks  
Aneesh L

---

<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:** [January 12, 2018, 5:46am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/8 "2018-01-12T05:46:18Z")

</div>

Yes. Scroll API.

---

<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:** [February 28, 2018, 6:01am UTC](https://discuss.elastic.co/t/max-size-for-getting-data/114851/10 "2018-02-28T06:01:50Z")

</div>

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