# Confused about why scroll api doesn't seem to function

**URL:** <https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327>\
**Category:** Elasticsearch\
**Created:** [October 18, 2016, 9:00pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327 "2016-10-18T21:00:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![timford2015](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@timford2015](https://discuss.elastic.co/u/timford2015)\
**Post date:** [October 18, 2016, 9:00pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/1 "2016-10-18T21:00:41Z")

</div>

```auto
curl 'http://localhost:9200/<index>/<type>/_search?scroll=1m' -H 'content-type: application/json;charset=UTF-8' -H 'accept: application/json' --data-binary '{"query":{"match_all":{}},"sort":["_doc"],"size":100}' --compressed

```

Output:

```auto
{"_index":"<index>","_type":"<type>","_id":"_search?scroll=1m","_version":5,"_shards":{"total":2,"successful":2,"failed":0},"created":false}

```

I have done some other things as well where the query is more complicated, but decided to take it to the simplest form available in the documentation. I was expecting to get back a "scroll\_id"

current version of elastic search

```auto
{
  "version" : {
    "number" : "2.3.4",
    "build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f",
    "build_timestamp" : "2016-06-30T11:24:31Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  }
}

```

---

<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:** [October 18, 2016, 9:17pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/2 "2016-10-18T21:17:59Z")

</div>

That output you posted is the response you get when creating a document.

Also it is nice to wrap code in ``` so it is highlighted and stuff. It is also useful to add `&pretty` to most uses of `curl` so it is easier to read the responses.

---

<div class="post-metadata">

**Author:** ![timford2015](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@timford2015](https://discuss.elastic.co/u/timford2015)\
**Post date:** [October 18, 2016, 9:48pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/3 "2016-10-18T21:48:19Z")

</div>

Any idea why its giving the document create response?

---

<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:** [October 18, 2016, 10:05pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/4 "2016-10-18T22:05:10Z")

</div>

I'm not sure! Something to do with the way you are invoking curl. Can you  
remove some of the options and try again? Usually I just use -X and -d.

---

<div class="post-metadata">

**Author:** ![timford2015](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@timford2015](https://discuss.elastic.co/u/timford2015)\
**Post date:** [October 18, 2016, 10:38pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/5 "2016-10-18T22:38:11Z")

</div>

yeah no change

---

<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:** [October 19, 2016, 1:59am UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/6 "2016-10-19T01:59:22Z")

</div>

I tried this and it worked as expected:

```auto
curl -XPOST localhost:9200/test/test?refresh -d'{"test":"test"}'
curl 'http://localhost:9200/test/test/_search?scroll=1m' -H 'content-type: application/json;charset=UTF-8' -H 'accept: application/json' --data-binary '{"query":{"match_all":{}},"sort":["_doc"],"size":100}' --compressed

```

Here is my `curl` version:

```auto
$ curl --version
curl 7.38.0 (x86_64-pc-linux-gnu) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP 

```

I'm not sure if there is anything else I can do for you though.

---

<div class="post-metadata">

**Author:** ![timford2015](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@timford2015](https://discuss.elastic.co/u/timford2015)\
**Post date:** [October 19, 2016, 9:20pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/7 "2016-10-19T21:20:43Z")

</div>

I found the issue --- was too confident in one of the components I was using in my system -- it was working just fine for normal queries -- when trying to use it for the scroll api it's failing for some reason i.e \_search vs \_search?scroll=1m -- very weird

---

<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:11pm UTC](https://discuss.elastic.co/t/confused-about-why-scroll-api-doesnt-seem-to-function/63327/8 "2017-07-05T22:11:06Z")

</div>


