# Term Aggregation on float\_range fields

**URL:** <https://discuss.elastic.co/t/term-aggregation-on-float-range-fields/118878>\
**Category:** Elasticsearch\
**Created:** [February 7, 2018, 4:11pm UTC](https://discuss.elastic.co/t/term-aggregation-on-float-range-fields/118878 "2018-02-07T16:11:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shibisoma](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Shibisoma](https://discuss.elastic.co/u/Shibisoma)\
**Post date:** [February 7, 2018, 4:11pm UTC](https://discuss.elastic.co/t/term-aggregation-on-float-range-fields/118878/1 "2018-02-07T16:11:14Z")

</div>

Hello, running in to some trouble trying to perform aggregation on a float\_range field. I have a field `NUM_AGE` which is of type `float_range` as specified in my mapping, which I would like to get all the unique values for. I've included the query and the error output, is this supported, and/or is there any workarounds?

Query:

```auto
GET toys/product/_search
{
  "size": 0,
  "aggregations": {
    "my_agg": {
      "terms": {
        "field": "NUM_AGE"
      }
    }
  }
}

```

Output:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Fielddata is not supported on field [NUM_AGE] of type [float_range]"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "toys",
        "node": "4rl9CsFoTEKt9JSnRT49Tg",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "Fielddata is not supported on field [NUM_AGE] of type [float_range]"
        }
      }
    ]
  },
  "status": 400
}

```

Cheers,

DS

---

<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:** [March 7, 2018, 4:11pm UTC](https://discuss.elastic.co/t/term-aggregation-on-float-range-fields/118878/2 "2018-03-07T16:11:26Z")

</div>

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