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

EuiSearchBar: allow arbitrary string when using quotes #2325

Closed
bevacqua opened this issue Sep 10, 2019 · 0 comments · Fixed by #3432
Closed

EuiSearchBar: allow arbitrary string when using quotes #2325

bevacqua opened this issue Sep 10, 2019 · 0 comments · Fixed by #3432

Comments

@bevacqua
Copy link
Contributor

bevacqua commented Sep 10, 2019

In Cloud UI, we have a use case where we sometimes even the powerful expressions possible with <EuiSearchBar> are not enough, and some of our users need a escape hatch to make ES queries directly. We can mostly get by by adding an es: string schema field, and letting them write whatever they want in there, then parsing that to mean query_string: $whatever on our end.

This, however, hinges on EUI allowing arbitrary strings to be passed as clause values. Currently, this happens when using double quotes:

es:"data.resources.cpu.hard_limit:false AND data.hidden:false"
☠️ es:"data.resources.cpu.hard_limit:false AND data.hidden:false AND size<=2048"
☠️ es:"data.resources.cpu.hard_limit:false AND data.hidden:'false'"

The fails indicate Expected end of input or whitespace but "\"" found.

Using single quotes seems to work just fine:

es:'data.resources.cpu.hard_limit:false AND data.hidden:false'
es:'data.resources.cpu.hard_limit:false AND data.hidden:"false"
es:'data.resources.cpu.hard_limit:false AND data.hidden:false AND size >= 2048'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants