# Java Scroll Api with aggregation

**URL:** https://discuss.elastic.co/t/java-scroll-api-with-aggregation/262798
**Category:** Elasticsearch
**Created:** [February 1, 2021, 8:27am UTC](https://discuss.elastic.co/t/java-scroll-api-with-aggregation/262798 "2021-02-01T08:27:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vands](https://avatars.discourse-cdn.com/v4/letter/v/cc9497/32.png) [@vands](https://discuss.elastic.co/u/vands)
#### Post date: [February 1, 2021, 8:27am UTC](https://discuss.elastic.co/t/java-scroll-api-with-aggregation/262798/1 "2021-02-01T08:27:46Z")

</div>

Hi All ,

I am using Java scroll API to fetch data from an index . Is it possible to use CompositeAggregationBuilder along with scroll api and get aggregation resultset in batches of 10000 from elastic . If so , please help me how to set the size of searchsourcebuilder and CompositeAggregationBuilder size.

Thanks In Advance,  
Vands

---

<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: [March 1, 2021, 8:28am UTC](https://discuss.elastic.co/t/java-scroll-api-with-aggregation/262798/2 "2021-03-01T08:28:02Z")

</div>

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