# How to scroll a particular request?

**URL:** https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684
**Category:** Elasticsearch
**Created:** [June 20, 2018, 12:14pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684 "2018-06-20T12:14:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![BoffinPanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boffinpanda/32/26225_2.png) [@BoffinPanda](https://discuss.elastic.co/u/BoffinPanda)
#### Post date: [June 20, 2018, 12:14pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/1 "2018-06-20T12:14:41Z")

</div>

Hello all.

I have a request -

{  
"size": 0,  
"\_source": {  
"excludes": []  
},  
"aggs": {  
"2": {  
"terms": {  
"field": "netflow.dst\_addr",  
"size": 100,  
"order": {  
"\_count": "desc"  
}  
},  
"aggs": {  
"3": {  
"terms": {  
"field": "netflow.src\_addr",  
"size": 100,  
"order": {  
"\_count": "desc"  
}  
}  
}  
}  
}  
},  
"stored\_fields": [  
"_"  
],  
"script\_fields": {},  
"docvalue\_fields": [  
"@timestamp",  
"netflow.first\_switched",  
"netflow.last\_switched"  
],  
"query": {  
"bool": {  
"must": [  
{  
"query\_string": {  
"analyze\_wildcard": True,  
"query": "_",  
"default\_field": "\*"  
}  
},  
{  
"range": {  
"@timestamp": {  
"gte": 1513752674812,  
"lte": 1529477474812,  
"format": "epoch\_millis"  
}  
}  
}  
],  
"filter": [],  
"should": [],  
"must\_not": []  
}  
}  
}

Now, I want to scroll the whole data so that I achieve some unique counts of a search term.

I have tried the regular scroll but it gives me the whole data and not what I have requested.

Does anyone know how to achieve it?

---

<div class="post-metadata">

### Author: ![TomTom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomtom/32/3676_2.png) [@TomTom](https://discuss.elastic.co/u/TomTom)
#### Post date: [June 20, 2018, 12:56pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/2 "2018-06-20T12:56:20Z")

</div>

Maybe this can solve your problem:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/\_executing\_aggregations.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/_executing_aggregations.html)

_Suggestion: Use the Preformatted text to put your code inside, makes it much easier to read the code_

---

<div class="post-metadata">

### Author: ![BoffinPanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boffinpanda/32/26225_2.png) [@BoffinPanda](https://discuss.elastic.co/u/BoffinPanda)
#### Post date: [June 20, 2018, 1:00pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/3 "2018-06-20T13:00:14Z")

</div>

Hey TomTom! I want to scroll the data as the size is \> 10k.

In the above link there is no support for scroll!

---

<div class="post-metadata">

### Author: ![TomTom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomtom/32/3676_2.png) [@TomTom](https://discuss.elastic.co/u/TomTom)
#### Post date: [June 20, 2018, 1:16pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/4 "2018-06-20T13:16:42Z")

</div>

In scroll you can use the 'aggs' without set a size, the scroll will count all data, even if you set the 'root' size as 10K.

---

<div class="post-metadata">

### Author: ![BoffinPanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boffinpanda/32/26225_2.png) [@BoffinPanda](https://discuss.elastic.co/u/BoffinPanda)
#### Post date: [June 20, 2018, 1:20pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/5 "2018-06-20T13:20:27Z")

</div>

Found this:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#\_filtering\_values\_with\_partitions](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions)

---

<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 18, 2018, 1:20pm UTC](https://discuss.elastic.co/t/how-to-scroll-a-particular-request/136684/6 "2018-07-18T13:20:32Z")

</div>

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