# Use of unmapped\_type in sorting

**URL:** <https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127>\
**Category:** Kibana\
**Tags:** eql-elastic-query-language, discover\
**Created:** [May 14, 2025, 10:06am UTC](https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127 "2025-05-14T10:06:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parthpuri\_Goswami](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/parthpuri_goswami/32/141878_2.png) [@Parthpuri\_Goswami](https://discuss.elastic.co/u/Parthpuri_Goswami)\
**Post date:** [May 14, 2025, 10:06am UTC](https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127/1 "2025-05-14T10:06:52Z")

</div>

Hi everyone,

In my application, I want to sort fields similar to the Kibana Discover page. While exploring Kibana APIs for sorting, I noticed that Kibana adds`unmapped_type: "boolean"` in sort query to all the fields. I just want to ask: is this a hardcoded value, or do I need to change it based on the data type or the data itself? I checked that Kibana adds the same `unmapped_type: "boolean"` to all fields, including integers and datetime fields etc.

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [May 14, 2025, 11:08am UTC](https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127/2 "2025-05-14T11:08:22Z")

</div>

Hi @Parthpuri_Goswami,

This setting is configurable via `sort:options` on Advanced Settings page. It should be based on the field type for the fields which are being sorted on.

There is an ongoing discussion how to improve this use case [Sorting in Discover can return no results and hide errors for unmapped fields · Issue #167375 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/167375)

If it causes issues on some shards, please consider adding "exist" filter in Discover UI for the same field too.

---

<div class="post-metadata">

**Author:** ![Parthpuri\_Goswami](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/parthpuri_goswami/32/141878_2.png) [@Parthpuri\_Goswami](https://discuss.elastic.co/u/Parthpuri_Goswami)\
**Post date:** [May 14, 2025, 11:56am UTC](https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127/3 "2025-05-14T11:56:58Z")

</div>

Hi @jughosta, Thanks for the quick response. Is there a public API available that provides access to Advanced Settings and fetch current value of sort:options?

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [May 20, 2025, 8:33am UTC](https://discuss.elastic.co/t/use-of-unmapped-type-in-sorting/378127/4 "2025-05-20T08:33:22Z")

</div>

Hi @Parthpuri_Goswami,

No, looks like there is no public API for it yet.
