# Elasticsearch: Validation Failed: 1: \[size\] cannot be \[0\] in a scroll context

**URL:** <https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871>\
**Category:** Uncategorized\
**Created:** [March 14, 2018, 12:49pm UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871 "2018-03-14T12:49:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tid](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/tid/32/5965_2.png) [@tid](https://community.dremio.com/u/tid)\
**Post date:** [March 14, 2018, 12:49pm UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871/1 "2018-03-14T12:49:30Z")

</div>

Hi there,

I’m working on a PoC in which we want to visualize data from Elasticsearch using Dremio as the bridge, i.e. without reflections activated.

Elasticsearch (6.2.2.) runs in single-node mode with auth turned off – basically, with default settings. Dremio: 1.4.9 with the latest JDBC Driver, running on Windows 7 (did I mention that this is a PoC? ;)).  
Executing basic queries, such as select \* work fine. However, **as soon as aggregate functions are included in the query, Elastic returns with a HTTP 400 "Validation Failed: 1: [size] cannot be [0] in a scroll context"**  
The most simple example I can give is select count(\*) FROM … which translates into  
`Query { "size" : 0, "query" : { "match_all" : { } } }`  
The HTTP Request looks like this: [http://10.21.46.50:9200/ny\_taxi\_data/rides/\_search?scroll=100000ms](http://10.21.46.50:9200/ny_taxi_data/rides/_search?scroll=100000ms)

Seems to me that the combination of scroll (pagination) and size: 0 seems invalid.

Any hints what I’m doing wrong? The problem occurs both when accessing via Dremio UI and JDBC.

Thanks and best regards, Tim

[75d19ac9-601b-47fa-846b-be1f69c97777.zip](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/1X/2c724910e79d7bf2be9fe03b093c0c93ae519db8.zip) (5.5 KB)

---

<div class="post-metadata">

**Author:** ![kelly](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kelly/32/11_2.png) [@kelly](https://community.dremio.com/u/kelly)\
**Post date:** [March 14, 2018, 2:26pm UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871/2 "2018-03-14T14:26:07Z")

</div>

Hey Tim, Dremio doesn’t yet support 6.x, so that may be the issue here.

[https://docs.dremio.com/data-sources/elasticsearch.html](https://docs.dremio.com/data-sources/elasticsearch.html)

Any chance you can try the same on 5.x? We won’t have 6.x until later this year.

What you’re trying to do normally works fine.

Hopefully you get the chance to experiment with Reflections, they can make a big performance difference. 🙂

---

<div class="post-metadata">

**Author:** ![tid](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/tid/32/5965_2.png) [@tid](https://community.dremio.com/u/tid)\
**Post date:** [March 14, 2018, 2:46pm UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871/3 "2018-03-14T14:46:09Z")

</div>

Hi Kelly,

thanks a lot for the quick reaction – awesome, just like the product 😉  
Seems like I didn’t check the manual properly ;( I actually assumed that 6.X must be working, because when I enable Reflections, Dremio happily sucks 15 Mln records out of Elastic and allows me to query the data in essentially no time (100 ms and less, depending on the complexity of the query of course).  
I also tried to import some huge CSV files and benchmarked it against our existing Spark 2.2 impl (on the same hardware) – wow 😉 Dremio beats Spark+Parquet by an order of magnitude (quick tests only, nothing that would qualify as a professional benchmark).

We depend on 6.X… Our project is not that urgent, so “later that year” could work…

Thanks, Tim

---

<div class="post-metadata">

**Author:** ![LucioDaza](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/luciodaza/32/1520_2.png) [@LucioDaza](https://community.dremio.com/u/LucioDaza)\
**Post date:** [September 10, 2018, 5:42pm UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871/4 "2018-09-10T17:42:48Z")

</div>

Hello Tim,  
Support for Elasticsearch 6.0 is now available in our latest release, Dremio 2.1. More details [here](https://docs.dremio.com/release-notes/21-release-notes.html).

---

<div class="post-metadata">

**Author:** ![tid](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/tid/32/5965_2.png) [@tid](https://community.dremio.com/u/tid)\
**Post date:** [September 14, 2018, 8:59am UTC](https://community.dremio.com/t/elasticsearch-validation-failed-1-size-cannot-be-0-in-a-scroll-context/871/5 "2018-09-14T08:59:51Z")

</div>

Hi Lucio,

thanks for the information! I’ll give the latest version a try.
