-
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
SavedObjectClient#find with KQL expression strings #78348
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Any idea on how we should change the public API if there some use cases where it should be able to call it with a Maybe we could split |
I think @kobelb suggested removing string completely from the SavedObjectsClient API, if there is an API which needs to accept strings (like the HTTP saved objects find API) then creating the KeuryNode from a string needs to happen inside the route handler (or any level above the saved objects client). |
Would it be worth spending the time to address #55485 first, and then make these changes to require a Otherwise y'all will be implementing the changes described here, only to have them removed again when we address that other issue. |
To address #55485, I thought we were just going to pull the "es_query" code out into a place where both |
Ah, sorry @kobelb, my comment above was assuming the original plan we had outlined in that issue, however I had missed your subsequent comment describing the challenges of that approach. The only issue with re-creating the I don't want to distract from the main topic of this issue, so I'll go ahead and comment on #55485 |
Closing this issue due to inactivity. |
KQL expression string parsing is slow. We've seen a complex KQL string take up to 250ms to parse. #76811 exists to discuss the KQL expression string parsing being slow and determine whether there are any performance improvements we can make. Assuming we're not able to get KQL expression string parsing performance where we need it to be, we'll instead need to minimize where it's performed.
The SavedObjectsClient#find
method currently allow a filter to be specified that is either a KQL expression string or aKueryNode
:kibana/src/core/server/saved_objects/types.ts
Line 90 in d666038
I think that we should change this to only accept a
KueryNode
. Specifying a KQL expression string is easier for the developer, so they will be prone to defaulting to using a string. If we only allow them to specify aKueryNode
, it will hopefully prompt them to constructing theKueryNode
manually, which is much more performant.However, There are some situations where we need to use a KQL expression string:
When the end-user is specifying the KQL expression string, developers can use
esKuery.fromQueryExpression
directly to get theKueryNode
which can then be passed toSavedObjectsClient#find
.The find route-handler will need to be changed to use
esKuery.fromQueryExpression
, before callingSavedObjectsClient#find
.The text was updated successfully, but these errors were encountered: