Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kibana filter auto suggestions order "starts with" instead of "contain" #65031

Closed
AlonaNadler opened this issue May 4, 2020 · 6 comments · Fixed by #68585
Closed

Kibana filter auto suggestions order "starts with" instead of "contain" #65031

AlonaNadler opened this issue May 4, 2020 · 6 comments · Fixed by #68585
Labels
bug Fixes for quality problems that affect the customer experience Feature:Filters loe:needs-research This issue requires some research before it can be worked on or estimated regression

Comments

@AlonaNadler
Copy link

In 6.8.x the filter combobox UI had a default prefix sort for the results drop down:

https://github.com/elastic/kibana/blob/6.8/src/ui/public/filter_editor/filter_field_select.html

Here is a screenshot of what it looked like on 6.8:

Screenshot_20200430_163645
image

When you type "ta" it sorts the results with the prefix matches first. However in 7.x now doesn't apply any prefix sorting.

Screenshot_20200501_100511
image

The customer wants the old 6.x behavior as they have many fields and when searching for some fields, its difficult to find when there's no prefix sorting like 6.x. This is their description of the issue:

A user within our environment has pointed out that the Filter field drop-down list on the Kibana Discover page now seems to be using a "contains" logic rather than "starts with". This means that things like "context" are now showing many field results even for fields that have the word "context" deep in the full field name. And because of this, the actual "context" field is not easy to find given the requirement to scroll through many fields that contain this word just to get to "context". He states that in Kibana 6.8.1, the functionality was using a "starts with" logic, which would ensure that when you type "context" you only get the fields that start with that, and not any fields where context is deep in the name.

As far as I know, this was not an intentional change in the filter behavior.
Ideally, this list would be sorted by "starts with" results at the top, then "contains" results below that,

@AlonaNadler AlonaNadler added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure labels May 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes timroes added Team:AppArch and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels May 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@AlonaNadler
Copy link
Author

@elastic/kibana-app-arch can someone take a look this seems like a regression

@Dosant Dosant added loe:needs-research This issue requires some research before it can be worked on or estimated Feature:Filters labels May 15, 2020
@AlonaNadler
Copy link
Author

AlonaNadler commented Jun 4, 2020

It also happens in visualize in 7.7 when searching for fields or aggregations. This is an extremely frustrating bug which causes additional clicks for many of the common operations

cc: @elastic-jb @alexh97 @ppisljar

@lukeelmers
Copy link
Member

I suspect this is due to conversion to EUI and how sorting is handled here.

In elastic/eui#652 it was identified that EUI combo boxes didn't respect the same sort order that the legacy angular ones did. This was addressed when they added a sortMatchesBy prop, which allows you to sort by startsWith.

Unfortunately, the default setting for this is none, which means devs need to explicitly opt-in to get the legacy behavior. It appears we aren't doing this in visualize editor or filters dropdown.

I'm testing whether this is, in fact, the case. But if it is, it will be a very simple fix.

@lukeelmers
Copy link
Member

I've opened #68585 to address this in the filter bar.

I briefly looked into sorting in on the aggregation types & field dropdowns in the vis default editor. However, due to the custom grouping & sorting that takes place in those dropdowns, I have not made changes there. Adding the prop caused items to be sorted to the top and therefore separated from their groupings, which may not be the desired behavior.

That is something that should be discussed separately with @elastic/kibana-app to determine a path forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Filters loe:needs-research This issue requires some research before it can be worked on or estimated regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants