-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Discover][ES|QL] Show loading indicator when DataView fields are fetched #179703
Comments
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Pinging @elastic/kibana-esql (Team:ESQL) |
@kertal could we not request the fields from dataview and use ES|QL instead. Specifically we can add a |
@stratoula so this would need a separate query, right? I think this is a direction worth to evaluate now that DataViewLazy arrived and we could also use the ES|QL result to add fields to a data view that didn't fetch any fields. However, still I think showing a loading indicator before this, no matter if it's powered by field_caps or ES|QL should be displayed, because the request can be slow in both cases. |
Where do we need fields list in ES|QL mode in Discover? Not for the sidebar as it gets fields from the text based columns coming together with the main results request. |
Ah I see, so the fields + types of the field list are already provided by the |
Exactly! Also the autocomplete works with ES|QL query and not the dataview fields |
Currently, when users are changing their ES|QL query, this triggers a fetching of fields. Due to the way Discover works we currently can't make use of the upcoming DataViewLazy to just fetch e.g. only the date field. This is a separate issue #178927
However, what we can do is show a loading indicator. Because else the interface just appears to be blocked, when the fields request takes a long time.
The relevant code can be found in the
fetchQuery
function: Before the query is sent to Elasticsearch, in case of ES|QL the query is checked for an existing index patterns. In the case there's a new/changed index pattern, a new data view is initialized, when then leads to a fetching of data view fields. This happens before the data state is reset and a loading indicator is displayed. Here's the codekibana/src/plugins/discover/public/application/main/services/discover_data_state_container.ts
Lines 299 to 318 in edd384a
What we should aim for is to send the data state reset msg earlier (with
sendResetMsg
), this will show the loading indicator before afield_caps
request can be triggeredThe prevent's the impression of a blocked interface without any reason
Originally posted by @kertal in #179120 (comment)
The text was updated successfully, but these errors were encountered: