Kibana 8.7 Control Sort

Hello,

i just checked out the new sorting functionallity for controls.

  • The default setting is to sort desc by doc count
    image
    I want asc alphabetically on every control. How can i change that in an easy way? I could not find a new setting related to this.
    Or do i have to go through every control and change it and save the dashboard afterwards? Will this even work or is this user specific? I know it works for the selection, so if i edit a dashboard and select anything in the control and save the dashboard afterwards, if another user opens the dashboard everytime this selections is in by default. Is it the same behaviour with the sort setting?
  • On some controls it does not work at all and i can't figure out why:
    image
    image
  • Usually the control is closed, if another one is selected. Although if the sort menu is open, only the submenu gets closed and not everything. This can result in this:

    A lot of opened control menues and from there every time you click on a control one extra window gets closed at a time. Looks like unintentional behaviour to me

Best regards
Jonas

1 Like

Another example of the alphabetical sort not working:
image
image

I want asc alphabetically on every control. How can i change that in an easy way? I could not find a new setting related to this. Or do i have to go through every control and change it and save the dashboard afterwards? Will this even work or is this user specific?

You do currently have to go to each control to set the default sort - after all, we support fields that don't support alphabetical sorting (for example, IP fields) and we have a range slider control that don't support the concept of sorting at all, so having it be a control group setting would be inconsistent and confusing.

I know it works for the selection, so if i edit a dashboard and select anything in the control and save the dashboard afterwards, if another user opens the dashboard everytime this selections is in by default. Is it the same behaviour with the sort setting?

Yes! If you select the sort in edit mode and then save the changes, this will be the default for everyone who opens the dashboard in view mode - we did this so that authors can choose the sorting technique that makes the most sense for a given field.

On some controls it does not work at all and i can't figure out why:

That is because that is a keyword type field, and so it is still sorting alphabetically (i.e. it is using "string sort" logic) and not numerically. We currently don't have support for numeric fields for options list controls, but you can track that enhancement here.

Usually the control is closed, if another one is selected. Although if the sort menu is open, only the submenu gets closed and not everything. This can result in this:

Looks like you caught a bug there - good catch! I'll file an issue :slight_smile:

Edit: You can track this bug here.

Good to see progress there. That's why i need to cast all my numbers to strings, so i can use controlls for them. But even if a string sort logic is used it should be 1 2 3 in asc and 3 2 1 in desc. Not 1 2 3 for both.
I understand that 1, 2, 10 would be sorted to 1 10 2 asc and 2 10 1 desc, but not 1 10 2 for both directions.

@Jonas_S Oh boy! Took a little while, but turns out you found a pretty sneaky little bug that is causing sorting to misbehave because of how we are storing the suggestions - the results from the ES query we are firing to grab the suggestions returns the values in the expected order, but we are parsing + storing the results in an object and Javascript is doing its own sorting based on the keys of that object. So you get some pretty weird results - good catch!

You can track this issue here :+1:

1 Like

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