# Aggregations not representative

**URL:** <https://forum.opensearch.org/t/aggregations-not-representative/3881>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [October 5, 2020, 1:45pm UTC](https://forum.opensearch.org/t/aggregations-not-representative/3881 "2020-10-05T13:45:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![okvittem](https://avatars.discourse-cdn.com/v4/letter/o/e19adc/32.png) [@okvittem](https://forum.opensearch.org/u/okvittem)\
**Post date:** [October 5, 2020, 1:45pm UTC](https://forum.opensearch.org/t/aggregations-not-representative/3881/1 "2020-10-05T13:45:20Z")

</div>

Hi,

I combine a a “query” with a subsequent “stats aggreations”. the idea is that the query limits the number of documents to be aggregated so that I could get aggregations on all pairs from/to fields in the aggregate. However there is still other\_doc\_count 3900 of total 5900 and only 15 % of pairs represented.  
How can i control this process - i.e. avoid statistical selection of documents?  
There is an overall limit of 10000 records to be returned in the api.

```
{ "size":0, 

```

“query”: { “range”: { “@date”:{ “gte”: “2020-10-05T11:50:14.704Z”, “lte”: “2020-10-05T12:50:14.704Z”, “time\_zone”:“Europe/Oslo” } } } ,  
“aggs”: { “from”: { “terms”: {“field”: “from.keyword” }, “aggs”: { “to”: { “terms”: {“field”: “to.keyword” }, “aggs”: { “h\_ddelay”: { “stats”: { “field”: “h\_ddelay” } }, “h\_jit”: {  
“stats”: { “field”: “h\_jit” } }, “h\_slope\_10”: { “stats”: { “field”: “h\_slope\_10” } }, “h\_min\_d”: { “stats”: { “field”: “h\_min\_d” } } } } } } } }’

---

<div class="post-metadata">

**Author:** ![kris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/kris/32/2208_2.png) [@kris](https://forum.opensearch.org/u/kris)\
**Post date:** [February 7, 2023, 12:00am UTC](https://forum.opensearch.org/t/aggregations-not-representative/3881/2 "2023-02-07T00:00:54Z")

</div>


