You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'
The text was updated successfully, but these errors were encountered:
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 anes: string
schema field, and letting them write whatever they want in there, then parsing that to meanquery_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'
The text was updated successfully, but these errors were encountered: