# Dashboard: "options list" entries sorting

**URL:** https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753
**Category:** Kibana
**Created:** [January 9, 2023, 5:34pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753 "2023-01-09T17:34:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hkhalil](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@hkhalil](https://discuss.elastic.co/u/hkhalil)
#### Post date: [January 9, 2023, 5:34pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753/1 "2023-01-09T17:34:03Z")

</div>

Hi,

We are using filtering controls in our dashboards ("Options List").

Specifically, one of our controls is for the following field:

```auto
"session_id": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }

```

I'm having a hard time understanding how the entries in the list are sorted. I would assume they're sorted alphabetically, but this still doesn't explain the behavior we're seeing.

![sorting](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a0631501970eb0b4d4a476f56178ac4b8937008c.png)

Can you please explain how sorting works and if there's any workaround that we can leverage to have our entries sorted numerically ?

The highlighted entries in the image above have the same length, so even if they were sorted lexicographically I would expect them to be in order.

Elastic version: 8.5.2

Thanks

---

<div class="post-metadata">

### Author: ![Hannah\_Mudge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_mudge/32/107993_2.png) [@Hannah\_Mudge](https://discuss.elastic.co/u/Hannah_Mudge)
#### Post date: [January 16, 2023, 6:13pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753/2 "2023-01-16T18:13:26Z")

</div>

Thanks for your question, @hkhalil!

Before `v8.7`, the options list suggestions were always sorted descending by **document count** - i.e., the values that are most common in your data would show up at the top, descending from there. This is what you are currently seeing - this means that `104490` occurs more often than `106959` which occurs more than `101290`, which is why you are seeing that ordering.

Once `v8.7`, is released, you will see that we added support for [dynamic sorting](https://github.com/elastic/kibana/pull/144867) - i.e. you will have the ability to sort by either document count or alphabetically, ascending or descending. Here's a quick little GIF of this in action:

![Jan-16-2023 11-11-34](https://us1.discourse-cdn.com/elastic/original/3X/8/9/8938eb5187d3b96786f89c3a12dee28f2e32840f.gif)

Note that you might still get slightly unexpected results when selecting alphabetical sorting for a numeric string, as alphabetical sorting is doing a **string** comparison and not a **numerical** comparison. So, `"10"` is actually less than `"2"` because it's only comparing the first character of `"10"` and `"1" < "2"`. This should be resolved once we had the ability to create options list controls on numeric fields 👍

---

<div class="post-metadata">

### Author: ![hkhalil](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@hkhalil](https://discuss.elastic.co/u/hkhalil)
#### Post date: [January 16, 2023, 7:38pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753/3 "2023-01-16T19:38:24Z")

</div>

Hi @Hannah_Mudge !

Thank you for the clear explanations and sharing features we can look forward to. These will definitely come in handy.

In terms of both `v8.7` and options list controls on numeric fields, is there a release window for them ?

Kind regards,  
Hussein

---

<div class="post-metadata">

### Author: ![Hannah\_Mudge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_mudge/32/107993_2.png) [@Hannah\_Mudge](https://discuss.elastic.co/u/Hannah_Mudge)
#### Post date: [January 16, 2023, 8:01pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753/4 "2023-01-16T20:01:57Z")

</div>

@hkhalil The planned release for `v8.7` is in late March, 2023. Adding support for numeric fields is on our roadmap for `v8.8` - you can keep track of the related issue [here](https://github.com/elastic/kibana/issues/126795) 👍

---

<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: [February 13, 2023, 8:01pm UTC](https://discuss.elastic.co/t/dashboard-options-list-entries-sorting/322753/5 "2023-02-13T20:01:59Z")

</div>

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