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
Add exclusion support to response filtering #19865
Conversation
"source", | ||
"filter_path", | ||
"filter_path_include", | ||
"filter_path_exclude"); |
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.
you should sync up with @elastic/es-clients to make sure that they make the same change in their clients/runners if needed. Otherwise their runners may barf as some parameters are provided although they are not listed in the api spec.
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.
I agree, but I finally removed the filter_path_excludes
and filter_path_includes
in favor of a +/-
support using the current filter_path
parameter, as Clinton suggested.
@tlrx what about ant syntax, eg
|
@clintongormley Sure, I also prefer this notation. |
This has been updated according to your comments @clintongormley @javanna |
-------------------------------------------------- | ||
|
||
And for more control, both inclusive and exclusive filters can be combined in the same expression: | ||
|
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.
Worth specifying which takes precedence: include or exclude
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.
I updated the doc.
left some minors LGTM otherwise |
06a531a
to
48c42a5
Compare
This commit adds the support for exclusion filter to the response filtering (filter_path) feature. It changes the XContentBuilder APIs so that it now accepts two types of filters: inclusive and exclusive. Filters are no more String arrays but sets of String instead.
48c42a5
to
b4245c7
Compare
Thanks @s1monw - merged with your suggestions. |
thanks @tlrx |
This PR adds support for excluding filters to the response filtering feature.
It adds the parameters
filter_path_include
andfilter_path_exclude
that can be used to combine inclusive and/or exclusive filters when filtering the response from a REST API request execution:When both
filter_path_include
andfilter_path_exclude
are set, it works by chaining twoFilteringGeneratorDelegate
: one for content exclusion and one for content inclusion (it always excludes first). If the whole content is filtered out, the output is an empty object.