Skip to content

Index patterns / scripted fields - convert sample data scripted fields to runtime fields#97651

Merged
mattkime merged 2 commits intoelastic:masterfrom
mattkime:sample_data_scripted_fields_to_runtime_fields
Apr 20, 2021
Merged

Index patterns / scripted fields - convert sample data scripted fields to runtime fields#97651
mattkime merged 2 commits intoelastic:masterfrom
mattkime:sample_data_scripted_fields_to_runtime_fields

Conversation

@mattkime
Copy link
Copy Markdown
Contributor

@mattkime mattkime commented Apr 20, 2021

Summary

Scripted fields are deprecated so our sample index patterns should use runtime fields instead.

closes: #97672

@mattkime mattkime changed the title kibana_sample_data_logs scripted field to runtime field Index patterns / scripted fields - convert sample data scripted fields to runtime fields Apr 20, 2021
@mattkime mattkime marked this pull request as ready for review April 20, 2021 16:32
@mattkime mattkime requested a review from a team as a code owner April 20, 2021 16:32
@mattkime mattkime added v8.0.0 v7.13.0 Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed Team:AppServices labels Apr 20, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

'[{"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());"}}}',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is the discrepancy between the hour_of_day type from number to long because of the saved objects attributes schema?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TinaHeiligers Good question. No, its because scripted fields use kibana types (javascript) whereas runtime fields use ES field types.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mattkime mattkime merged commit 9b7b7b8 into elastic:master Apr 20, 2021
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
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 20, 2021
…s to runtime fields (#97651) (#97704)

* kibana_sample_data_logs scripted field to runtime field

* use runtime field instead of scripted field for flights sample data

Co-authored-by: Matthew Kime <matt@mattki.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Index pattern / scripted fields - convert sample data scripted fields to runtime fields

5 participants