# Scroll search request returns documents but Scan does not

**URL:** <https://discuss.elastic.co/t/scroll-search-request-returns-documents-but-scan-does-not/2424>\
**Category:** Elasticsearch\
**Created:** [June 11, 2015, 8:19am UTC](https://discuss.elastic.co/t/scroll-search-request-returns-documents-but-scan-does-not/2424 "2015-06-11T08:19:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lisak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisak/32/618_2.png) [@lisak](https://discuss.elastic.co/u/lisak)\
**Post date:** [June 11, 2015, 8:19am UTC](https://discuss.elastic.co/t/scroll-search-request-returns-documents-but-scan-does-not/2424/1 "2015-06-11T08:19:38Z")

</div>

Hi,

I'm talking about the initial search request only, not the following scroll requests. If I do this :  
`GET foo/_search?scroll=5m&search_type=scan`  
I get scroll\_id and an empty hits array :

```auto
{
   "_scroll_id": "foo",  
   "hits": {
      "total": 270223,
      "max_score": 0,
      "hits": []
   }
}

```

But if I don't set `search_type` to `scan` :  
`GET foo/_search?scroll=5m`  
I get `scroll_id` AND **the first batch of results !**

This is a total drag because you can't maintain any kind of abstraction over scrolling components that are both scrolling and scanning.

**EDIT: I just noticed of this comment in documentation that compares scroll with scan :**

> The response of the initial search request will not contain any results in the hits array. The first results will be returned by the first scroll request.

---

<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, 12:06am UTC](https://discuss.elastic.co/t/scroll-search-request-returns-documents-but-scan-does-not/2424/2 "2017-07-06T00:06:29Z")

</div>


