Skip to content

Conversation

@jdconrad
Copy link
Contributor

@jdconrad jdconrad commented Nov 8, 2021

This adds a shortcut for the field method when a script context supports the scripting fields API. This shortcut replaces field('fieldname').get(defaultValue) with $('fieldname', defaultValue). This change builds this into the Painless compiler, but eventually this can be easily refactored out to make it so the '$' could be specialized per context.

@jdconrad jdconrad added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v8.1.0 labels Nov 8, 2021
@jdconrad jdconrad requested a review from stu-elastic November 8, 2021 23:51
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Nov 8, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with some tests and a comment on the way forward regarding the specialization of $ in the asm phase.

@jdconrad
Copy link
Contributor Author

@stu-elastic Thanks for the review! Will add some more tests and roll from there.

@jdconrad
Copy link
Contributor Author

jdconrad commented Dec 1, 2021

Added additional tests. Will commit as soon as CI passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants