# Scroll and scan issue, no new scroll\_id generated

**URL:** <https://discuss.elastic.co/t/scroll-and-scan-issue-no-new-scroll-id-generated/8652>\
**Category:** Elasticsearch\
**Created:** [August 6, 2012, 10:35pm UTC](https://discuss.elastic.co/t/scroll-and-scan-issue-no-new-scroll-id-generated/8652 "2012-08-06T22:35:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abshkd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abshkd/32/2789_2.png) [@abshkd](https://discuss.elastic.co/u/abshkd)\
**Post date:** [August 6, 2012, 10:35pm UTC](https://discuss.elastic.co/t/scroll-and-scan-issue-no-new-scroll-id-generated/8652/1 "2012-08-06T22:35:40Z")

</div>

Hi  
I am stuck on a weird problem.

I am running a text\_phrase query over a range of timestamps. this query is  
perfectly fine. I want to download the entire result (some 1.5 million  
documents) so I used scan + scroll\_id method.

This is my Curl

curl -XGET  
'remotehost:9200/graylog2/messsage/\_search?search\_type=scan&scroll=10m&size=10'  
-d '  
{  
"query":{"bool":{"must":[{"text":{"message":"this is an  
error"}},{"range":{"created\_at":{"from":"1341597072","to":"1344275472"}}}]}}  
}

I get the scrollid in response as we should.

next step: use the scroll id on the \_Search endpoint

curl -XGET 'remotehost:9200/\_search/scroll?scroll=10m' -d  
'c2Nhbjs1OzgwOnRxMnhsNGhuVFZxeE0xUTRyN3piYlE7Nzk6dHEyeGw0aG5UVnF4TTFRNHI3emJiUTs3ODp0cTJ4bDRoblRWcXhNMVE0cjd6YmJROzc3OnRxMnhsNGhuVFZxeE0xUTRyN3piYlE7NzY6dHEyeGw0aG5UVnF4TTFRNHI3emJiUTsxO3RvdGFsX2hpdHM6MTIwNDQ3NTs='

However the response gives me back the same scroll id in the json  
['\_scroll\_id']

So what happens is that I can make one more query with the above scroll id  
after which it will fail.

{"error":"ArrayIndexOutOfBoundsException[174]","status":500}

I am not sure what I am doing wrong here, please help?

thank you

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 7, 2012, 9:27pm UTC](https://discuss.elastic.co/t/scroll-and-scan-issue-no-new-scroll-id-generated/8652/2 "2012-08-07T21:27:12Z")

</div>

Are you using the scroll id from the previous response as the one to use for the next request?

On Aug 7, 2012, at 12:35 AM, abshkd [abhishek.dujari@gmail.com](mailto:abhishek.dujari@gmail.com) wrote:

> Hi  
> I am stuck on a weird problem.
> 
> I am running a text\_phrase query over a range of timestamps. this query is perfectly fine. I want to download the entire result (some 1.5 million documents) so I used scan + scroll\_id method.
> 
> This is my Curl
> 
> curl -XGET 'remotehost:9200/graylog2/messsage/\_search?search\_type=scan&scroll=10m&size=10' -d '  
> {  
> "query":{"bool":{"must":[{"text":{"message":"this is an error"}},{"range":{"created\_at":{"from":"1341597072","to":"1344275472"}}}]}}  
> }
> 
> I get the scrollid in response as we should.
> 
> next step: use the scroll id on the \_Search endpoint
> 
> curl -XGET 'remotehost:9200/\_search/scroll?scroll=10m' -d 'c2Nhbjs1OzgwOnRxMnhsNGhuVFZxeE0xUTRyN3piYlE7Nzk6dHEyeGw0aG5UVnF4TTFRNHI3emJiUTs3ODp0cTJ4bDRoblRWcXhNMVE0cjd6YmJROzc3OnRxMnhsNGhuVFZxeE0xUTRyN3piYlE7NzY6dHEyeGw0aG5UVnF4TTFRNHI3emJiUTsxO3RvdGFsX2hpdHM6MTIwNDQ3NTs='
> 
> However the response gives me back the same scroll id in the json ['\_scroll\_id']
> 
> So what happens is that I can make one more query with the above scroll id after which it will fail.
> 
> {"error":"ArrayIndexOutOfBoundsException[174]","status":500}
> 
> I am not sure what I am doing wrong here, please help?
> 
> thank you

---

<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:** [July 6, 2017, 3:17am UTC](https://discuss.elastic.co/t/scroll-and-scan-issue-no-new-scroll-id-generated/8652/3 "2017-07-06T03:17:26Z")

</div>


