# Rollup - type \[RangeAggregationBuilder\] is currently unsupported

**URL:** <https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418>\
**Category:** Elasticsearch\
**Created:** [August 14, 2018, 10:22pm UTC](https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418 "2018-08-14T22:22:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Ainslie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_ainslie/32/55031_2.png) [@Paul\_Ainslie](https://discuss.elastic.co/u/Paul_Ainslie)\
**Post date:** [August 14, 2018, 10:22pm UTC](https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418/1 "2018-08-14T22:22:53Z")

</div>

Is there a way of rewriting this query so it works on a \_rollup\_search? It works on the raw index, but I get this error on the rollup index.

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Unable to translate aggregation tree into Rollup. Aggregation [my_date_range] is of type [RangeAggregationBuilder] which is currently unsupported."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Unable to translate aggregation tree into Rollup. Aggregation [my_date_range] is of type [RangeAggregationBuilder] which is currently unsupported."
  },
  "status": 400
}

```

Here's the query:

```auto
{
  "size": 0,
  "query": {
    "match_all": {}
  },
  "aggs": {
    "my_date_range": {
      "range": {
        "field": "@timestamp",
         "format": "YYYY-MM-DD",
        "ranges": [
          {
            "from": "2017-09-01"
          },
          {
            "to": "2017-09-30" 
          }
        ]
      },
      "aggs": {
        "total_bytes": {
          "sum": {
            "field": "bytes"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [August 21, 2018, 9:37pm UTC](https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418/2 "2018-08-21T21:37:33Z")

</div>

Hey @Paul_Ainslie, sorry for the delay in responding.

Range aggs aren't supported at the moment. I think we could probably support them with the data we store right now (e.g. just the timestamp buckets), although it may be limited support due to bucket intervals. I've opened an issue to track this request: [https://github.com/elastic/elasticsearch/issues/33041](https://github.com/elastic/elasticsearch/issues/33041)

Since you only have one range, you could rewrite it to use a range filter in the query (from `2017-09-01` to `2017-09-30`) instead of using the date range aggregation. Then just use a `sum` aggregation by itself, since the data will be filtered by the query.

---

<div class="post-metadata">

**Author:** ![Paul\_Ainslie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_ainslie/32/55031_2.png) [@Paul\_Ainslie](https://discuss.elastic.co/u/Paul_Ainslie)\
**Post date:** [August 23, 2018, 3:36am UTC](https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418/3 "2018-08-23T03:36:23Z")

</div>

Thanks Zachary! I tried the range filter instead of using the date range aggregation and it worked... plus it's way, way faster! That reduced 7 second queries down to 0.2 seconds! Spread the word!

I converted a number of our queries over to range filters until I tried to convert a Sum Bucket Aggregation and then my results were wrong. But I'll post that seperately.

---

<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:** [September 20, 2018, 3:36am UTC](https://discuss.elastic.co/t/rollup-type-rangeaggregationbuilder-is-currently-unsupported/144418/4 "2018-09-20T03:36:28Z")

</div>

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