Use of unmapped_type in sorting

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 addsunmapped_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.

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

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

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?

Hi @Parthpuri_Goswami,

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

1 Like