-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Make scripted search templates work with new mediaType from XContentType.JSON #67677
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
Merged
pgomulka
merged 9 commits into
elastic:master
from
pgomulka:scripting/content_type_charset_change
Jan 21, 2021
Merged
Make scripted search templates work with new mediaType from XContentType.JSON #67677
pgomulka
merged 9 commits into
elastic:master
from
pgomulka:scripting/content_type_charset_change
Jan 21, 2021
Conversation
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
pgomulka
commented
Jan 19, 2021
pgomulka
commented
Jan 19, 2021
pgomulka
commented
Jan 19, 2021
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Contributor
Author
|
I removed the Script.java related changes to a separate PR |
jdconrad
approved these changes
Jan 20, 2021
Contributor
jdconrad
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. Thanks for working on this!
martijnvg
approved these changes
Jan 21, 2021
Member
martijnvg
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
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
>non-issue
Team:Core/Infra
Meta label for core/infra team
v8.0.0-alpha1
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.
Stored scripts can have
content_typeoption set, however when empty they default toXContentType.JSON#mediaType(). Commit 5e74f79 has changed this in master (ES8) method to returnapplication/json;charset=utf-8(previouslyapplication/json; charset=UTF-8)This means that when upgrading ES from version 7 to 8 stored script will fail when being used as the encoder is being matched with string equality (map key)
elasticsearch/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/CustomMustacheFactory.java
Lines 62 to 66 in 5e74f79
This commit address this by adding back (in addition) the old
application/json; charset=UTF-8into the encoders map.closes #66986