# How to change size during scroll

**URL:** <https://discuss.elastic.co/t/how-to-change-size-during-scroll/209265>\
**Category:** Elasticsearch\
**Created:** [November 25, 2019, 9:34am UTC](https://discuss.elastic.co/t/how-to-change-size-during-scroll/209265 "2019-11-25T09:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shashwat001](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashwat001/32/58268_2.png) [@shashwat001](https://discuss.elastic.co/u/shashwat001)\
**Post date:** [November 25, 2019, 9:34am UTC](https://discuss.elastic.co/t/how-to-change-size-during-scroll/209265/1 "2019-11-25T09:34:56Z")

</div>

I am running scroll on multiple indexes which are built on timeseries data. I have an index for each day with a common prefix in indexname. Earlier I was giving index name wildcard to serve scroll but since it was using all indices, the performance was very slow.  
So for optimization I am trying to implement scroll per index starting from latest index to oldest index. Now I am stuck at a place.

I fetch 10 records per scroll. When I am changing the index when all records of current index are consumed, I don't want to fetch 10 records from new index but just the remaining to make total as 10 records. From next scroll call I would want to fetch 10 records.

I think scroll doesn't provide changing the scroll batch size. Is there any way to handle 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:** [December 23, 2019, 9:34am UTC](https://discuss.elastic.co/t/how-to-change-size-during-scroll/209265/2 "2019-12-23T09:34:57Z")

</div>

Closed on December 23, 2019, 9:34am UTC

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