Index patterns / scripted fields - convert sample data scripted fields to runtime fields#97651
Merged
mattkime merged 2 commits intoelastic:masterfrom Apr 20, 2021
Conversation
Contributor
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
Bamieh
approved these changes
Apr 20, 2021
| '[{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', | ||
| fieldFormatMap: '{"hour_of_day":{}}', | ||
| runtimeFieldMap: | ||
| '{"hour_of_day":{"type":"long","script":{"source":"emit(doc[\'timestamp\'].value.getHour());"}}}', |
Contributor
There was a problem hiding this comment.
Out of curiosity, is the discrepancy between the hour_of_day type from number to long because of the saved objects attributes schema?
Contributor
Author
There was a problem hiding this comment.
@TinaHeiligers Good question. No, its because scripted fields use kibana types (javascript) whereas runtime fields use ES field types.
Contributor
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 20, 2021
…s to runtime fields (elastic#97651) * kibana_sample_data_logs scripted field to runtime field * use runtime field instead of scripted field for flights sample data
Contributor
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
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.
Summary
Scripted fields are deprecated so our sample index patterns should use runtime fields instead.
closes: #97672