# Elasticsearch 2.3.3 Scroll result doesnt deliver hits

**URL:** https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447
**Category:** Elasticsearch
**Created:** [June 21, 2016, 7:49am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447 "2016-06-21T07:49:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![michaelzollmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelzollmann/32/10428_2.png) [@michaelzollmann](https://discuss.elastic.co/u/michaelzollmann)
#### Post date: [June 21, 2016, 7:49am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447/1 "2016-06-21T07:49:08Z")

</div>

I am using elasticsearch 2.3.3. I have indexed 3 documents which i want to scroll.  
To get a scrollId i send:  
curl -XGET 'localhost:8082/entities\_alias/entity/\_search?scroll=1m&pretty' -d '  
{  
"query": {  
"match\_all": {}  
}  
}  
'  
which returns me a scrollId and my 3 hits  
{  
"\_scroll\_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs=",  
"took" : 3,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "entities",  
"\_type" : "entity",  
"\_id" : "PIRlWdgfNrzHUNhA",  
"\_score" : 1.0,  
"\_source" : {  
"id" : "PIRlWdgfNrzHUNhA",  
"parent\_id" : null,  
"contentmodel\_id" : "level1", ...  
...

Then i try to scroll by calling  
curl -XGET 'localhost:8082/\_search/scroll' -d'  
{  
"scroll" : "1m",  
"scroll\_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs="  
}  
'  
which returns me  
{  
"\_scroll\_id" : "cXVlcnlUaGVuRmV0Y2g7NTsyNjo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI4OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7Mjc6NXUzRFpOeU5STjY4MF9RQWNrNVZWdzszMDo1dTNEWk55TlJONjgwX1FBY2s1VlZ3OzI5OjV1M0RaTnlOUk42ODBfUUFjazVWVnc7MDs=",  
"took" : 2,  
"timed\_out" : false,  
"terminated\_early" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 1.0,  
"hits" : []  
}  
}

So totalHits is 3 but hits[] is empty. How can i get the Hits for my scroll?

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [June 21, 2016, 4:21pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447/2 "2016-06-21T16:21:31Z")

</div>

The first search request will return a scroll\_id and a set of hits. Since you only have 3 documents, they are all returned in the first search. A second call to the scroll API with that scroll\_id will return blank, since the scroll cursors were exhausted in the first call.

If you index a lot more documents, you'll be able to see how the scrolling behavior works past the first page.

---

<div class="post-metadata">

### Author: ![michaelzollmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelzollmann/32/10428_2.png) [@michaelzollmann](https://discuss.elastic.co/u/michaelzollmann)
#### Post date: [June 22, 2016, 8:27am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447/3 "2016-06-22T08:27:19Z")

</div>

Ah, now i understand. Thanks a lot for your help!

---

<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 5, 2017, 10:41pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-scroll-result-doesnt-deliver-hits/53447/4 "2017-07-05T22:41:28Z")

</div>


