# Elasticsearch and scrolling in increments

**URL:** <https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610>\
**Category:** Elasticsearch\
**Created:** [November 19, 2016, 5:16am UTC](https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610 "2016-11-19T05:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rheng](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@rheng](https://discuss.elastic.co/u/rheng)\
**Post date:** [November 19, 2016, 5:16am UTC](https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610/1 "2016-11-19T05:16:48Z")

</div>

Say i have 100,000 indices. i can do

curl -XGET '10.55.91.111:9200/house/node2/\_search?scroll=10m&size=100000' -d

but as the indices grow, i would probably run out of heap space.

So my question is can i do the search in say increments of 1000?

so something like this...

while size \< 1000

```
count = 1000
#curl -XGET '10.55.91.111:9200/house/node2/_search?scroll=10m&size=<count>' -d

_search the first 1000
process the information
now get the next 1000
process the information
until i hit 10000

I saw something where the curl command allows you to search from 1 to 1000,
then search from 1001 to 2000...etc..
```

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [November 19, 2016, 12:56pm UTC](https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610/2 "2016-11-19T12:56:52Z")

</div>

Scroll like that should retune a scroll id which you can use with the  
scroll API to continue where that API left off.

---

<div class="post-metadata">

**Author:** ![rheng](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@rheng](https://discuss.elastic.co/u/rheng)\
**Post date:** [November 19, 2016, 7:39pm UTC](https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610/6 "2016-11-19T19:39:57Z")

</div>

Okay. i got it to work. The one below works:

curl -XGET '10.55.304.22:9200/\_search/scroll?scroll=20m' -d 'cXVlcnlUaGVuRmV0Y2g7NTsxODM5MTE6alVhTTY0bnVTdy0wc2RpR3lndFhXZzsxODQzODU6eG94by1rY1dSM2VFSWNJTkJJZEJYQTsxODM5MTI6alVhTTY0bnVTdy0wc2RpR3lndFhXZzsxODQzODY6eG94by1rY1dSM2VFSWNJTkJJZEJYQTsxODQzODc6eG94by1rY1dSM2VFSWNJTkJJZEJYQTswOw=='

---

<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:** [December 17, 2016, 7:40pm UTC](https://discuss.elastic.co/t/elasticsearch-and-scrolling-in-increments/66610/7 "2016-12-17T19:40:08Z")

</div>

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