-
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
Fix issue preventing KQL filters aggs with leading wildcards. #67227
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
@@ -67,8 +67,13 @@ export const filtersBucketAgg = new BucketAggType({ | |||
return; | |||
} | |||
|
|||
const query = esQuery.buildEsQuery(aggConfig.getIndexPattern(), [input], [], config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was that config
which was passed here is chrome.getUiSettingsClient()
, instead of { allowLeadingWildcards: config.get('query:allowLeadingWildcards') }
So allowLeadingWildcards
would default to false
, and then fail when trying to parse the query.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Closes #57828
Summary
This resolves an issue where KQL-based filters aggs in visualizations could fail in scenarios where leading wildcards are used, even when
query:allowLeadingWildcards
is set totrue
.Opening a PR against the
7.6
branch directly because this issue does not exist in7.7
and later, that way this fix will be included should there be a7.6.3
release. I have opened a separate PR with the added unit tests againstmaster
, so that we can prevent future regressions.I was unable to pinpoint the exact root cause -- the code which fixed the problem has essentially remained unchanged since KQL was added to the filters agg back in
7.3
. But one suspicion I have is that perhaps something changed related tobuildEsQuery
when@kbn/es-query
was converted to typescript and moved todata
in #51014, since this is one other major piece related to this functionality which was moved around in7.6
Checklist