Sorting by range_* field

GET 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?

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