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

[Unified Search] Field autocomplete only matches from the beginning of the field name #158876

Open
Tracked by #169986
timductive opened this issue Jun 1, 2023 · 12 comments
Labels
blocked Feature:Unified search Unified search related tasks impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure usability

Comments

@timductive
Copy link
Member

The Field autocomplete starts matching from the beginning of the field, but many long field names are only unique at the end of the field name. Think "cluster.host.name.id" where you want to search on just the "id".
image

Searching "devtiol" should match this field.
image

@timductive timductive added Team:Visualizations Visualization editors, elastic-charts and infrastructure impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Feature:Unified search Unified search related tasks labels Jun 1, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@timductive
Copy link
Member Author

image
We need to consider the UX of the autocomplete suggestions for these long fields names too.

@dej611
Copy link
Contributor

dej611 commented Sep 4, 2023

I think this task can be better addressed once the EuiCombo component gets the EuiTextTruncate feature in: elastic/eui#7028

@JasonStoltz
Copy link
Member

@dej611 @timductive Now that elastic/eui#7028 has been completed, is there additional work required by the EUI team to complete this task?

@dej611
Copy link
Contributor

dej611 commented Sep 22, 2023

Looking at new behaviour of Combobox with the new truncation feature, I would say we should be good:

Screenshot 2023-09-22 at 10 45 39

@stratoula
Copy link
Contributor

@dej611 yes seems great, has the EUI version which contains this feature be merged in Kibana?

@dej611
Copy link
Contributor

dej611 commented Sep 22, 2023

I can see it landing here: #166868

@dej611
Copy link
Contributor

dej611 commented Sep 25, 2023

While #166868 solves the truncation problem, I think there's still some work on our side for this feature to be done as it looks search findings are wiped out with an add custom option X if the search doesn't match from the beginning:

truncated_search_suggestions

@dej611
Copy link
Contributor

dej611 commented Sep 29, 2023

Had a quick look at this use case but it can be quite challening to support autocomplete beside starting matches:

  • in order to support other types of matching it requires the allowLeadingWildcards - even just for this internal use cases - with potential performance issues
  • support a "half" solution of filtering the current results (provided by ComboBox matching algo) AND in case of no suggestions retrieved by the autocomplete, use the partial former results - might be ok, but results can be misleading here
  • Support clearly only matches who starts with query string - this means even reduce the ComboBox searching feature to only match at the beginning of the string

@dej611
Copy link
Contributor

dej611 commented Sep 29, 2023

Note that for the field name instead it seems to work great:

Screenshot 2023-09-29 at 13 02 20

@cee-chen
Copy link
Member

cee-chen commented Nov 6, 2023

(Cross-posting this comment from elastic/eui#7236 for more visibility and to get more UX feedback)

I strongly think this usage of EuiComboBox should be using the async and isLoading props. Here is what the end UX would look like (essentially the flash of incorrect matches in #158876 (comment) is replaced by a loading message instead):

kibana

While the load time doesn't necessarily feel great, this is (IMO) the more technically correct approach that we specifically demo in our docs, and also given that EuiComboBox does not know the full list of suggestions (if they're async) and could therefore also be suggesting incomplete items regardless of matching logic.

You can pull down my spike here to test this locally: main...cee-chen:kibana:combobox-async-suggestions

@ryankeairns
Copy link
Contributor

ryankeairns commented Nov 7, 2023

EUI seems to be providing a set of capabilities that can be worked into a solution here, so I am in favor of closing the sibling issue over there. As for this issue, I am a +1 for Cee's recommendation - the loading state feels warranted and is more accurate than potentially showing a partial (and misleading) set of results.

We acknowledge that there are likely some UX guidelines needed for building such search experiences. We'll track that in our patterns work and, ultimately, provide a clearer take on how we believe search should behave (e.g. don't show partial results, match anywhere in the string, etc.).

shahzad31 pushed a commit to shahzad31/kibana that referenced this issue Nov 20, 2023
…ic#171427)

## Summary

This PR does NOT address
elastic#158876, but helps reduce the
confusion/cognitive dissonance of the async search results only matching
on words from the start of the string, vs. `EuiComboBox` showing search
results from anywhere in the string by default.

Please see https://eui.elastic.co/#/forms/combo-box#async for more
documentation on async searching.

### Before

![image](https://user-images.githubusercontent.com/924948/270275373-0d0df8c3-3a03-40e9-bc79-ea353147e419.gif)

### After


![image](https://user-images.githubusercontent.com/549407/280421058-a7476a75-bfbe-49c6-be81-7bd0b46e048c.gif)

### Checklist

- ~[ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios~ No tests found
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Feature:Unified search Unified search related tasks impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure usability
Projects
None yet
Development

No branches or pull requests

7 participants