[7.x] Update Painless Fields API design to use mapped types (#78950)#79201
Merged
jdconrad merged 5 commits intoelastic:7.xfrom Oct 18, 2021
Merged
[7.x] Update Painless Fields API design to use mapped types (#78950)#79201jdconrad merged 5 commits intoelastic:7.xfrom
jdconrad merged 5 commits intoelastic:7.xfrom
Conversation
This change updates the Painless fields API to use mapped types instead of Java types. For this initial release we only support unsigned long field. As we now intend to do conversions solely on the field classes themselves, converters and field values have been removed. Instead of using field values potentially as source fallback we will now rely on whatever class is passed into the script to support the field method. In the future, this method will need to check if a field exists on doc and if not, then do source fallback itself once that feature is supported. The path to retrieve a field is also different. Instead of using script doc values we now have our own way to retrieve the fields with a getScriptField method added to LeafDocLookup. This allows us less restrictive design space to generate the field type based the type in the leaf doc lookup; however, this will still require additional information that we need to plumb through for certain field types. Once we support all the field types this makes it easier to deprecate and remove script doc values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 7.x: