elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.68k stars 8.23k forks source link

[ES|QL] Improve feedback on empty autosuggest when is due to some error in the request #175996

Open dej611 opened 9 months ago

dej611 commented 9 months ago

Describe the feature:

Autosuggest in ES|QL relies on the current context to suggest fields/stuff to the user in the current position. While the current logic builds carefully the query to send over to ES in order to return a clean list of the columns to extract suggestions from for the user, sometimes some instructions within the built query can throw some exceptions on the ES side. This leads to an empty resultset which is not always clear.

An example can be an invalid pattern for the DISSECT/GROK command:

FROM index | GROK stringField "invalid-pattern" | KEEP <here>

In the <here> position no field will actually be suggested as the previous command GROK will throw an error and ES will report an empty table. The one above is an example and there are other routes that the validation engine cannot spot beforehand that leads to the same scenario.

Describe a specific use case for the feature: I think we could evaluate various solutions here, but foremost have a way to report in the autosuggest system that something in the query sent went wrong would be useful (i.e. enrich the validation results by adding the response's errors from server or show a message in the suggestions popover).

Some other idea would be to fallback to a list of suggestions without the erroring part (e.g. isolate the error at command level and submit a new query without that specific erroring command), or just proposed the previous computed list without re-submitting.

elasticmachine commented 9 months ago

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

elasticmachine commented 8 months ago

Pinging @elastic/kibana-esql (Team:ESQL)