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

Issues with Kibana 8.9.0 + EuiSearchBar ("@elastic/eui": "82.1.0") #7023

Closed
brenoandrade-wdrv opened this issue Aug 1, 2023 · 5 comments
Closed
Labels
bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible

Comments

@brenoandrade-wdrv
Copy link

Describe the bug
Kibana 8.9.0 has recently introduced a new bug related to the EuiSearchBar component in the "@elastic/eui" library with version 82.1.0. The issue originates from a change made in the pull request found at #6717. This change inadvertently affected the functionality of the EuiSearchBar.Query.toESQuery() method.

To be more specific, the problem lies with the "+" character, which was causing unintended issues when using the EuiSearchBar.Query.toESQuery() method. As a result, external plugins were unable to approach the queryString as expected.

As a temporary solution, I have implemented a quick fix by removing the "+" character from the query terms. This workaround has proven to be effective, and the EuiSearchBar component is now functioning properly.

Environment and versions

  • EUI version: 82.1.0
  • React version: 17.0.2
  • Kibana version (if applicable): 8.9.0
  • Browser: Chrome
  • Operating System: Ubuntu / Windows

To Reproduce
Steps to reproduce the behavior:
1 - Import the https://eui.elastic.co/#/forms/search-bar control in your external Kibana plugin
2 - Try to use the EuiSearchBar.Query.toESQuery() method in order to provide a quick search.
3 - The search will not run properly

Expected behavior
SearchBar component running queryString properly in Kibana 8.9.0

Minimum reproducible sandbox

Screenshots

Additional context
elastic/kibana#162907

@cee-chen
Copy link
Contributor

cee-chen commented Aug 3, 2023

@s-nel do you mind chiming in on this and whether it's intentional based on your changes in #6717? Do we need to escape + characters that are typed into EuiSearchBar to resolve this issue?

editing to add - this is reproducible on https://eui.elastic.co/#/forms/search-bar by typing, e.g. hello+world into the search bar. The demo will error. Disregard this comment, it's a red herring.

@s-nel
Copy link
Contributor

s-nel commented Aug 3, 2023

To be more specific, the problem lies with the "+" character, which was causing unintended issues when using the EuiSearchBar.Query.toESQuery() method. As a result, external plugins were unable to approach the queryString as expected.

Can you be more specific? EUI is producing valid simple_query_string queries unless you have some examples where it isn't. Is the external plugin sending the Elasticsearch query to Elasticsearch? What is the error you're receiving? Is it transforming the query first?

Do we need to escape + characters that are typed into EuiSearchBar to resolve this issue? editing to add - this is reproducible on https://eui.elastic.co/#/forms/search-bar by typing, e.g. hello+world into the search bar. The demo will error.

We should escape all special characters used in simple_query_string syntax, but that was an issue before the addition of +. I just tested it in 77.1.1 and it gives the same error.

@cee-chen
Copy link
Contributor

cee-chen commented Aug 4, 2023

We should escape all special characters used in simple_query_string syntax, but that was an issue before the addition of +. I just tested it in 77.1.1 and it gives the same error.

Ahh, apologies for muddying the waters with that. Let's just focus on @brenoandrade-wdrv's issue in that case. @brenoandrade-wdrv, we need more information from you. Either a CodeSandbox that demonstrates the error, more complete error logs, or more specific repro steps (the current steps in your PR description are too vague to reproduce).

FWIW, https://eui.elastic.co/#/forms/search-bar#search-bar-filters is currently using EuiSearchBar.Query.toESQuery(query) (click the demo JS tab to see) and has no issues or errors. If you can find some way of making our docs example error in the manner you're seeing, that would be most helpful. You can also edit demo examples in CodeSandbox directly to help with reproduction behavior:

@brenoandrade-wdrv
Copy link
Author

Dear folks, I'll use this Sandbox and manage a minified example from Kibana 8.9.0 over the Search Bar component in order to reproduce the issue I've been experiencing. - Will let you know soon, probably by the next week or so. Thanks for putting your thoughts on this matter.

@cee-chen
Copy link
Contributor

Hey @brenoandrade-wdrv - it's been about a week and a half, so we're going to go ahead and close this as can't repro for now. If you're able to repro this later please feel free to leave a comment and we can re-open it, or open an entirely new issue.

@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible
Projects
None yet
Development

No branches or pull requests

3 participants