# Does scroll with query string work?

**URL:** <https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904>\
**Category:** Elasticsearch\
**Created:** [March 9, 2016, 2:26pm UTC](https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904 "2016-03-09T14:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalitr](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@lalitr](https://discuss.elastic.co/u/lalitr)\
**Post date:** [March 9, 2016, 2:26pm UTC](https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904/1 "2016-03-09T14:26:46Z")

</div>

We are using **Elasticsearch 2.1.0** and tried using the query string with the scroll getting all the results from an index (small sized just 26k docs) but that doesn't seem to be working from the query string;

The first query is like this;  
[http://localhost:9200/index/type/\_search?scroll=1m&size=100](http://localhost:9200/index/type/_search?scroll=1m&size=100) -- this does return 100 records with a \_scroll\_id in the response.

And the next query we fire is this;  
[http://localhost:9200/\_search?scroll=1m&size=100](http://localhost:9200/_search?scroll=1m&size=100) &scroll\_id=\<scroll\_id\_from\_prev\_qry\_result\> -- this query instead of returning docs from the same index returns docs from all the indexes in our cluster

The documentation here [elasticsearch-2.1-reference](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/search-request-scroll.html) does say "For backwards compatibility, scroll\_id and scroll can be passed in the query string" but it doesn't seem to work as expected.

However the same requests using curl -XGET seems to be work fine.

Has anybody tried this out ? Is there any known issue using scroll with query string or am missing something out here ?

Also if scroll works with the query string then is the sort = \_doc also supported with the query string ?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [March 9, 2016, 3:09pm UTC](https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904/2 "2016-03-09T15:09:05Z")

</div>

> [@lalitr](#):
>
> [http://localhost:9200/\_search?scroll=1m&size=100](http://localhost:9200/_search?scroll=1m&size=100)

You seem to be missing the `scroll` endpoint after `_search`, so it performs a regular march\_all on the whole cluster. I just tried this and it works:

```auto
http://localhost:9200/_search/scroll?scroll=1m&size=100&scroll_id=...

```

---

<div class="post-metadata">

**Author:** ![lalitr](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@lalitr](https://discuss.elastic.co/u/lalitr)\
**Post date:** [March 9, 2016, 4:12pm UTC](https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904/4 "2016-03-09T16:12:54Z")

</div>

ohhw okie .. what a bummer - all that to just figure out missing an endpoint.

That worked. Thanks for your response.

---

<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, 11:09pm UTC](https://discuss.elastic.co/t/does-scroll-with-query-string-work/43904/5 "2017-07-05T23:09:52Z")

</div>


