Skip to content
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

Merged
merged 4 commits into from
May 28, 2020

Conversation

lukeelmers
Copy link
Member

@lukeelmers lukeelmers commented May 21, 2020

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 to true.

Opening a PR against the 7.6 branch directly because this issue does not exist in 7.7 and later, that way this fix will be included should there be a 7.6.3 release. I have opened a separate PR with the added unit tests against master, 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 to buildEsQuery when @kbn/es-query was converted to typescript and moved to data in #51014, since this is one other major piece related to this functionality which was moved around in 7.6

Checklist

@lukeelmers lukeelmers added Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) release_note:fix Feature:KQL KQL Team:AppArch v7.6.3 labels May 21, 2020
@lukeelmers lukeelmers requested a review from a team May 21, 2020 22:11
@lukeelmers lukeelmers self-assigned this May 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@lukeelmers lukeelmers added this to Review in progress in kibana-app-arch May 21, 2020
@@ -67,8 +67,13 @@ export const filtersBucketAgg = new BucketAggType({
return;
}

const query = esQuery.buildEsQuery(aggConfig.getIndexPattern(), [input], [], config);
Copy link
Member Author

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.

@lukeelmers

This comment has been minimized.

@lukeelmers

This comment has been minimized.

@lukeelmers
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:KQL KQL release_note:fix v7.6.3
Projects
kibana-app-arch
  
Done in current release
4 participants