# Scan and Scroll 100 Index Limit

**URL:** <https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819>\
**Category:** Elasticsearch\
**Created:** [September 23, 2015, 1:01am UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819 "2015-09-23T01:01:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![voipoclay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voipoclay/32/4372_2.png) [@voipoclay](https://discuss.elastic.co/u/voipoclay)\
**Post date:** [September 23, 2015, 1:01am UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819/1 "2015-09-23T01:01:12Z")

</div>

Hello all,

I seem to be getting 0 results when my query exceeds 100 shards.

Below seems to work but any time shards is greater than 100 it returns nothing.

I was wondering if anyone else experienced this?

```
["took"]=>
  int(11)
  ["timed_out"]=>
  bool(false)
  ["_shards"]=>
  array(3) {
    ["total"]=>
    int(100)
    ["successful"]=>
    int(100)
    ["failed"]=>
    int(0)
  }
  ["hits"]=>
  array(3) {
    ["total"]=>
    int(3)
    ["max_score"]=>
    float(0)
    ["hits"]=>
    array(0) {
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 23, 2015, 1:04am UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819/2 "2015-09-23T01:04:09Z")

</div>

What does your request look like?

---

<div class="post-metadata">

**Author:** ![voipoclay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voipoclay/32/4372_2.png) [@voipoclay](https://discuss.elastic.co/u/voipoclay)\
**Post date:** [September 23, 2015, 3:24am UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819/3 "2015-09-23T03:24:25Z")

</div>

Thanks for the reply!

My request looks like the following... also each index (per day) is 5 shards 1 replica.

POST /pbxcdr-2015.09.01%2Cpbxcdr-2015.09.02%2Cpbxcdr-2015.09.03%2Cpbxcdr-2015.09.04%2Cpbxcdr-2015.09.05%2Cpbxcdr-2015.09.06%2Cpbxcdr-2015.09.07%2Cpbxcdr-2015.09.08%2Cpbxcdr-2015.09.09%2Cpbxcdr-2015.09.10%2Cpbxcdr-2015.09.11%2Cpbxcdr-2015.09.12%2Cpbxcdr-2015.09.13%2Cpbxcdr-2015.09.14%2Cpbxcdr-2015.09.15%2Cpbxcdr-2015.09.16%2Cpbxcdr-2015.09.17%2Cpbxcdr-2015.09.18%2Cpbxcdr-2015.09.19%2Cpbxcdr-2015.09.20%2Cpbxcdr-2015.09.21%2Cpbxcdr-2015.09.22%2Cpbxcdr-2015.09.23%2Cpbxcdr-2015.09.24%2Cpbxcdr-2015.09.25%2Cpbxcdr-2015.09.26%2Cpbxcdr-2015.09.27%2Cpbxcdr-2015.09.28%2Cpbxcdr-2015.09.29%2Cpbxcdr-2015.09.30%2Cpbxcdr-2015.10.01/cdr/\_search?search\_type=scan&scroll=30s&size=500&ignore\_unavailable=1&allow\_no\_indices=1  
{"query":{"filtered":{"query":{"bool":{"must":[{"match":{"dom.domain":"[www.google.com](http://www.google.com)"}}]}},"filter":{"range":{"@timestamp":{"gte":"2015-09-01T00:00:00-07:00","lte":"2015-09-30T23:59:59-07:00"}}}}}}

---

<div class="post-metadata">

**Author:** ![voipoclay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voipoclay/32/4372_2.png) [@voipoclay](https://discuss.elastic.co/u/voipoclay)\
**Post date:** [September 23, 2015, 10:55pm UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819/4 "2015-09-23T22:55:26Z")

</div>

found the answer to my own question.

Following the api at the following link [https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/\_search\_operations.html#\_scan\_scroll](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_search_operations.html#_scan_scroll) ... I found that using scroll\_id in the URI became too long in the while loop so it didn't work once indices reached a certain size.

Specifying it the way the docs say to makes it a GET request and therefore eventually truncates the request URI. I just removed it and made the body attribute the scroll\_id and then it converted it to a POST request and problem solved.

```
             try {
                 // Execute a Scroll request
                 $response = $this->elastic->scroll(
                     array(
                         //"scroll_id" => $scroll_id, //...using our previously obtained _scroll_id
                         "scroll" => "15s", // and the same timeout window
                         "body" => $scroll_id
                     )   
                 );  
             } catch (\Exception $e) {
                 var_dump($e->getMessage());
             }   

```

Adding this here for anyone else who encounters this.

---

<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:48pm UTC](https://discuss.elastic.co/t/scan-and-scroll-100-index-limit/29819/5 "2017-07-05T23:48:24Z")

</div>


