# Rollup search + aggregation total count

**URL:** https://discuss.elastic.co/t/rollup-search-aggregation-total-count/172783
**Category:** Elasticsearch
**Created:** [March 18, 2019, 1:44pm UTC](https://discuss.elastic.co/t/rollup-search-aggregation-total-count/172783 "2019-03-18T13:44:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rubarax](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rubarax/32/42238_2.png) [@rubarax](https://discuss.elastic.co/u/rubarax)
#### Post date: [March 18, 2019, 1:44pm UTC](https://discuss.elastic.co/t/rollup-search-aggregation-total-count/172783/1 "2019-03-18T13:44:30Z")

</div>

Hi all,

I have a rollup job defined that groups by the following fields: server, user, method (it also handles different metrics not relevant for this question)

I know that I cannot use some aggregations types in the rollup searches (like cardinality), but... since I can aggregate by user:

```
GET rollup_index/_rollup_search
{
  "size":0,
  "aggs": {
    "daily": {
      "date_histogram": {
        "field": "timestamp",
        "interval": "24h"
      },
      "aggs": {
        "users": {
          "terms": {
                "field": "user",
                "size": 5000                
          }
        }
      }
    }
  }
}

```

and I only need the count of users, it doesn't make any sense that I have to retrieve the list of all users to get the total count.

So, is there any way so I can just get the total count?

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: [April 15, 2019, 1:44pm UTC](https://discuss.elastic.co/t/rollup-search-aggregation-total-count/172783/2 "2019-04-15T13:44:40Z")

</div>

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