# Sorting by range\_\* field

**URL:** <https://discuss.elastic.co/t/sorting-by-range--field/92863>\
**Category:** Elasticsearch\
**Created:** [July 12, 2017, 6:32pm UTC](https://discuss.elastic.co/t/sorting-by-range--field/92863 "2017-07-12T18:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeves095](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeves095/32/20014_2.png) [@zeves095](https://discuss.elastic.co/u/zeves095)\
**Post date:** [July 12, 2017, 6:32pm UTC](https://discuss.elastic.co/t/sorting-by-range--field/92863/1 "2017-07-12T18:32:59Z")

</div>

GET [http://localhost:9200/myIndex/\_search](http://localhost:9200/myIndex/_search)  
{  
"sort" : {  
"my\_range\_double\_field": {"order":"desc", "mode":"max"}  
}  
}

i've got error:

```
{
   "error": {
      "root_cause": [
         {
            "type": "illegal_argument_exception",
            "reason": "Fielddata is not supported on field [my_range_double_field] of type [double_range]"
         }
      ],
      "type": "search_phase_execution_exception",
      "reason": "all shards failed",
      "phase": "query",
      "grouped": true,
      "failed_shards": [
         {
            "shard": 0,
            "index": "myIndex",
            "node": "1sz2zGeWTTeNVPl7XhojZw",
            "reason": {
               "type": "illegal_argument_exception",
               "reason": "Fielddata is not supported on field [my_range_double_field] of type [double_range]"
            }
         }
      ]
   },
   "status": 400
}

```

The question - is how to sort by range field?

---

<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:** [August 9, 2017, 6:33pm UTC](https://discuss.elastic.co/t/sorting-by-range--field/92863/2 "2017-08-09T18:33:16Z")

</div>

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