Skip to content

Borrow more tests for runtime fields#61113

Merged
nik9000 merged 3 commits intoelastic:feature/runtime_fieldsfrom
nik9000:runtime_fields_moar_tests
Aug 17, 2020
Merged

Borrow more tests for runtime fields#61113
nik9000 merged 3 commits intoelastic:feature/runtime_fieldsfrom
nik9000:runtime_fields_moar_tests

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Aug 13, 2020

This "borrows" 150 more tests from core for runtime fields, extending
the work done in #60931. More precisely, it adds a template to every
test that forces dynamic mapping updates to build runtime fields where
possible. In particular, long and double field are created as
runtime fields. string-typed fields are mimick the out of the box
behavior and create a top level text field with a .keyword
multi-field, but this keyword multi-field executes a script and loads
from source.

This "borrows" 150 more tests from core for runtime fields, extending
the work done in elastic#60931. More precisely, it adds a template to every
test that forces dynamic mapping updates to build runtime fields where
possible. In particular, `long` and `double` field are created as
runtime fields. `string`-typed fields are mimick the out of the box
behavior and create a top level `text` field with a `.keyword`
multi-field, but this `keyword` multi-field executes a script and loads
from source.
@nik9000 nik9000 added the :Search/Search Search-related issues that do not fall into other categories label Aug 13, 2020
@nik9000 nik9000 requested review from javanna and jtibshirani August 13, 2020 19:04
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Aug 13, 2020
Copy link
Copy Markdown
Contributor

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM

Map.entry("script", painlessToLoadFromSource("{name}", type))
);
Map<String, Object> body = Map.ofEntries(
Map.entry("match_mapping_type", type.equals("keyword") ? "string" : type),
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.

what is string here? Is it the old field type string from before we had text and keyword?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it is! Dynamic templates mostly uses the types that we use but it uses string instead of text or keyword.

@javanna javanna mentioned this pull request Aug 17, 2020
30 tasks
@nik9000 nik9000 merged commit 76eb16e into elastic:feature/runtime_fields Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants