title: How can I bring information from ElasticSearch in batches if it is on many levels?
body: <p>I have info in ES. The mapping is very simple :</p>
  
  <pre><code>{
      "index": {
          "aliases": {},
          "mappings": {
              "level1": {
                  "properties": {
                      "id": {
                          "type": "string"
                      },
                      "level2": {
                          "type": "nested",
                          "properties": {
                              "level3": {
                                  "type": "nested",
                                  "properties": {
                                      "value1": {
                                          "type": "string"
                                      },
                                      "value2": {
                                          "type": "long"
                                      },
                                      "id": {
                                          "type": "string"
                                      },
                                      "value3": {
                                          "type": "long"
                                      }
                                  }
                              },
                              "id": {
                                  "type": "string"
                              }
                          }
                      }
                  }
              }
          },
          "settings": {
              "index": {
                  "creation_date": "1505476515647",
                  "number_of_shards": "5",
                  "number_of_replicas": "1",
                  "uuid": "_0IiQCPrQ1i-kDP1481y8w",
                  "version": {
                      "created": "2030099"
                  }
              }
          },
          "warmers": {}
      }
  }
  </code></pre>
  
  <p>and when i do the query:</p>
  
  <pre><code> {"query": {"terms": {"_id": [ "value51" ] }}}
  </code></pre>
  
  <p>I receive data with this structure:</p>
  
  <pre><code>_source (dict)
    level1 (list)
       level2 (list)
          data1 (dict)
                id
                value1
                value2
                value3
          data2 (dict)
          data3 (dict)
          ...
          data65000 (dict)
  </code></pre>
  
  <p>The problem is that 65,000 data are too many, and I run out of memory, I would like to know if _search or ElasticSearch in general has some way of bringing that information (data1,data2,data3...) in batches. Or if there is some way to make that query so that I do not run out of memory on the computer. Any idea?</p>
  
  <p>Thank you!</p>