-
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
Fixes breaking change introduced in #95558. #95711
Fixes breaking change introduced in #95558. #95711
Conversation
Documentation preview: |
Pinging @elastic/es-search (Team:Search) |
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.
Looks great, thanks. Left one small comment around docs.
*Note:* when specifying patterns (for `match`, `unmatch`, etc.) in an array, | ||
{es} enforces that all values must be strings. However, for backwards | ||
compatibility, {es} allows non-string values (such as numbers) for | ||
single-valued match (and unmatch) fields. |
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 wonder if we should document this. My worry is that users may end up relying on this behaviour, while it is there only to prevent breaking templates. We could consider as a follow-up deprecating non string single values. What do you think?
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.
Yeah, I agree. Users should probably never use anything except strings, so probably good not to encourage the other usage. I'll remove it.
Match and unmatch fields in dynamic_templates (match, unmatch, path_match, path_unmatch) can either be single-valued or a list of values. If a list of values is provided, the values must all be strings. Numbers, boolean, other lists, etc. are not allowed and an error will be returned to the user in that case. However, previously (before elastic#95558) we allowed any JSON type for the match/unmatch fields (not just string), so changing that would be a breaking change. Thus, this commit no longer enforces string-only types for single-valued match/unmatch fields in dynamic_templates.
71fe7ef
to
8e6a0d4
Compare
Match and unmatch fields in dynamic_templates (match, unmatch, path_match, path_unmatch) can either be single-valued or a list of values. If a list of values is provided, the values must all be strings. Numbers, boolean, other lists, etc. are not allowed and an error will be returned to the user in that case.
However, previously (before #95558) we allowed any JSON type for the match/unmatch fields (not just string), so changing that would be a breaking change. Thus, this commit no longer enforces string-only types for single-valued match/unmatch fields in dynamic_templates.