# Is sorting on Text/String field no longer available in 5.x?

**URL:** <https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586>\
**Category:** Elasticsearch\
**Created:** [December 9, 2016, 4:21pm UTC](https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586 "2016-12-09T16:21:41Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [December 10, 2016, 3:09am UTC](https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586/8 "2016-12-10T03:09:09Z")

</div>

> [@juminoz](#):
>
> I thought there is no longer type "string" in 5.x? That's why I changed it to "text". So to make it work, I need to continue using string? That doesn't sound right.

There's a disconnect for this, the "dynamic" type used for `match_mapping_type` is the type of the field, not necessarily the ES type. For instance, `match_mapping_type` only supports "long", not "integer" because it maps to the data type rather than an ES type. So even though ES itself uses "text" and "keyword", the data type is still a "string".

I agree this is confusing, there was a PR here: [Elasticsearch should reject dynamic templates with unknown `match_mapping_type`. by jpountz · Pull Request #17285 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/17285) for 5.0+ that adds deprecation logging for this, and I opened [Throw an exception on unrecognized "match\_mapping\_type" by dakrone · Pull Request #22090 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/22090) so 6.0 will throw an exception when an unrecognized type is used.

---

_[View the full topic](https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586)._
