# SCAN and Scroll in TopHits Aggregation

**URL:** <https://discuss.elastic.co/t/scan-and-scroll-in-tophits-aggregation/36463>\
**Category:** Elasticsearch\
**Created:** [December 6, 2015, 12:45pm UTC](https://discuss.elastic.co/t/scan-and-scroll-in-tophits-aggregation/36463 "2015-12-06T12:45:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramanareddy438](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@ramanareddy438](https://discuss.elastic.co/u/ramanareddy438)\
**Post date:** [December 6, 2015, 12:45pm UTC](https://discuss.elastic.co/t/scan-and-scroll-in-tophits-aggregation/36463/1 "2015-12-06T12:45:38Z")

</div>

I have to categorize the data based on some value . For this I am using terms aggregation and get the data using TopHits aggregation. Is there a possibility to do the same scroll option here?

Any other better approach to get all the records of a bucket?  
Please do let me know if needed any further information.  
Thanks in advance.

---

<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:33pm UTC](https://discuss.elastic.co/t/scan-and-scroll-in-tophits-aggregation/36463/2 "2017-07-05T23:33:15Z")

</div>


