# Can i using 'Scroll API' to elasticsearch with vega in kibana?

**URL:** <https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271>\
**Category:** Kibana\
**Created:** [January 22, 2019, 4:15pm UTC](https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271 "2019-01-22T16:15:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teemoGod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teemogod/32/40817_2.png) [@teemoGod](https://discuss.elastic.co/u/teemoGod)\
**Post date:** [January 22, 2019, 4:15pm UTC](https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271/1 "2019-01-22T16:15:58Z")

</div>

hi. im using elasticsearch / kibana 6.4.1

im using built-in vega in kibana.

im using deep sub-aggregation query. (almost 7 depth)

but there are some performance issue. too slow to use multiple aggregation.

so, i thinking about 'how about only use 'hits' field'.

but, 'query' query's max size is 10000.

but i need more datas.

can i using scroll api in built-in vega in kibana?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 24, 2019, 8:32pm UTC](https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271/2 "2019-01-24T20:32:18Z")

</div>

This doesn't seem possible as with the Scroll API, you need to capture a scroll cursor and supply it to multiple searches to get a chunk of hits at a time, and then clear the scroll when it's done. Vega would have to be able to "detect" that you're trying to use the scroll API and do it's own cursor management and re-query for you. It doesn't do that: it will give ES what you tell it to, but it doesn't know your intention.

Also take note, from [Request body search | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html)

> Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration.

It sounds like this advice is for you: if the amount of data you have is too large to query in the form that it is, it could be re-processed and have the raw stats rolled up into summarized forms that can actually be visualized.

---

<div class="post-metadata">

**Author:** ![teemoGod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teemogod/32/40817_2.png) [@teemoGod](https://discuss.elastic.co/u/teemoGod)\
**Post date:** [January 25, 2019, 7:43am UTC](https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271/3 "2019-01-25T07:43:18Z")

</div>

@tsullivan

thx for your response and thx for your advice.

so helpful and hopeful idea. 😄

---

<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:** [February 22, 2019, 7:43am UTC](https://discuss.elastic.co/t/can-i-using-scroll-api-to-elasticsearch-with-vega-in-kibana/165271/4 "2019-02-22T07:43:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
