-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 Fields API to aggregation scripts and field scripts #76325
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
@@ -140,6 +143,24 @@ | |||
filter.add(filterWhitelist); | |||
map.put(FilterScript.CONTEXT, filter); | |||
|
|||
List<Whitelist> aggregation = new ArrayList<>(); |
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.
At this point we should have something like getRuntimeFieldWhitelist
for this API since a lot of this config code is the same.
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.
Agreed, I would prefer to do this as a follow up PR. I even wonder if this should maybe be moved elsewhere. The entirety of including these contexts as part of the module is a bit of an afterthought, though I understand doing them through SPI doesn't make sense here given the dependency hierarchy.
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.
Well we should cleanup the whitelisting code. Next PR is fine, but if we wanna do a more fundamental change then I'd prefer the wl code cleanup happen first.
modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml
Outdated
Show resolved
Hide resolved
modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/20_scriptfield.yml
Outdated
Show resolved
Hide resolved
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.
very nice, a couple of requests.
@stu-elastic Thanks for the review! I believe I've addressed your comment and will commit once CI passes. |
@elasticmachine run elasticsearch-ci/part-1 |
This change updates the aggregation script, map script for aggregations, and field scripts to extend DocBasedScript to give them access to the new fields api.
💚 Backport successful
|
This change updates the aggregation script, map script for aggregations, and field scripts to extend DocBasedScript to give them access to the new fields api.