-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Make array value parsing flag more robust. #63354
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
Conversation
When constructing a value fetcher, the 'parsesArrayValue' flag must match `FieldMapper#parsesArrayValue`. However there is nothing in code or tests to help enforce this. This PR reworks the value fetcher constructors so that `parsesArrayValue` is 'false' by default. Just as for `FieldMapper#parsesArrayValue`, field types must explicitly set it to true and ensure the behavior is covered by tests. Follow-up to elastic#62974.
|
Pinging @elastic/es-search (:Search/Search) |
nik9000
left a comment
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.
Makes sense to me! I'll let @romseygeek review because it sounds like he understands the problem better.
romseygeek
left a comment
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.
LGTM, much nicer. Thanks @jtibshirani!
|
Thank you both for the reviews ! |
When constructing a value fetcher, the 'parsesArrayValue' flag must match `FieldMapper#parsesArrayValue`. However there is nothing in code or tests to help enforce this. This PR reworks the value fetcher constructors so that `parsesArrayValue` is 'false' by default. Just as for `FieldMapper#parsesArrayValue`, field types must explicitly set it to true and ensure the behavior is covered by tests. Follow-up to elastic#62974.
When constructing a value fetcher, the 'parsesArrayValue' flag must match
FieldMapper#parsesArrayValue. However there is nothing in code or tests tohelp enforce this.
This PR splits out a class
ArraySourceValueFetcherthat handles array valuesdirectly and removes the flag. That way most field types can use the default
SourceValueFetcher. Field types that handle array values opt to useArraySourceValueFetcherand ensure the behavior is covered by tests.Follow-up to #62974.