-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
KQL/Kuery support for TSVB, timelion and Vega visualizations #17722
Comments
@elastic/kibana-discovery I am not exactly aware how to work with KQL yet. We would need to open a PR that has an |
Dashboard should not treat the query like a filter anymore. The only reason that was necessary in the past was because queries did not get merged when the SearchSource hierarchy was flattened. I changed that back in 6.0, queries now get merged, and if my memory serves I also updated dashboard so it wouldn't put the query in the filters anymore. I'm not sure how this Also, as long as SearchSource is being used, no special handling of KQL is necessary. |
I assigned myself, will look into it when I can but no promises on a soon-ish time. |
This came up in a meeting today with @ppisljar, @timroes , @Bargs and @spalger. Turns out there is no simple fix for this, and once we pass filters, queries, etc down from dashboard to embeddables directly, it will negate the need for this entire file. The problem with a quick fix is that even though there is an available conversion function available, something like So for now, we are living with this limitation since they are all experimental features, until we can clean up search source issues and pass down filters/queries, etc directly (issue pending for that goal). |
Got rid of the bug label since technically we are considering this an unsupported feature. |
|
From Vega's perspective, it needs an API to convert current dashboard's context to the |
Hi, kind of new here, I had a go at upgrading made by @PhaedrusTheGreek - transform_vis plugin. I removed dashboard context and replaced it with query/filters section, it installed sucessfully to my surprise however whenever I try to use second argument of myRequestHandler I somehow get "Cannot read property 'appState' of undefined" as a global error on a kibana when creating new vis. I cannot debug what's the actual argument passed to my custom Request Handler it comes either as undefined when the vis comes defined as an proper object. According to a documentation (from ES site for 6.6.0) it should be there along with uiState and timeRange? Or have I missed anything? @PhaedrusTheGreek btw thanks mate this vizualisation of yours gives awesome flexibility in creating custom views :). |
It seems that only one object is passed over (vis) not 2 as it was before, however documentations remains unchanged. I managed to launch transform_vis with success :). There are still a little tweaks to be done but I think it works now. |
This was fixed in #28010 |
I have the same problem like syberyjskimisiek |
@Classic92, if I remember correctly only one object is returned through myRequestHandler. This was the main change. You need to change your code to accept 1 object instead of 2, and somehow resolve the appState being undefined issue. |
Currently none of the above visualizations listen for KQL/Kuery queries, if that feature is enabled.
The reason for this is the usage of the broken dashboard_context for generating the DSL for a query. This plainly ignores if the query is actually written in KQL/Kquery.
This class should be removed completely and rather the correct way of implementing this should be used:
The request handler of a visualization will get passed in the
filters
andquery
in the params object (2nd argument to the request handler). Every visualization should use thatquery
andfilters
instead of trying to access any global state (likedashboard_context
does). Accessing global state in any visualization will break other features that we are planning like Custom time ranges per dashboard panel (#17776). It's an anti pattern that makes the whole architecture unstable and hard to maintain.A visualization needs to look into filters/queries passed to it's request handler. To compile the query, there are APIs for Lucene and Kuery. We should imho look into creating one central "Query API" (cc @elastic/kibana-discovery), that accepts any query object and that itself will check what query type that query is and use the appropriate compiler. That way we don't duplicate that work into each individual visualization.
That compiled DSL needs then to be merged into the query done by the appropriate visualization. Since KQL/Kuery needs to be compiled against an index pattern, all visualizations need to figure out the appropriate index pattern, for their given index pattern string (maybe we could move that into the Query compile API?).
The text was updated successfully, but these errors were encountered: