-
Notifications
You must be signed in to change notification settings - Fork 8k
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] Provide utility function to extract needed fields of a KQL query #180555
Comments
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
I found out there is a utility that probably provides this functionality here: kibana/x-pack/plugins/observability_solution/apm/common/utils/get_kuery_fields.ts Line 11 in d228f48
cc @mattkime |
@mattkime qq: is this issue still necessary? is the functionality of the utility @lukasolson sufficient? Thx |
I took a brief look at the function that @lukasolson suggested, just copied and tried it out, yes, it should work, we might consider to import it to |
## Summary Resolves #180555. Adds a utility to kbn-es-query for getting the field names associated with a KQL expression. This utility already (mostly) existed in x-pack/plugins/observability_solution/apm/common/utils/get_kuery_fields.ts but didn't have test coverage for things like wildcards and nested fields. This also updates the utility to be a little more robust in checking the KQL node types. ### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Matthew Kime <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Originally posted by @lukasolson in #175081
This is a requirement to decouple DataView field / field caps requests from search source requests. We are aiming to reduce the amount of fields that's necessary when a search source is being fetched. Currently when there's no given data view, we initialize a new data view and this triggers a request for all fields. This should be optimized to just request the fields that are needed. For this purpose a utility function should be created, to return the necessary field names of a given KQL query, that can be used in a data view field request to just return those.
The text was updated successfully, but these errors were encountered: