You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge mappings for composable index templates (#58521)
This PR implements recursive mapping merging for composable index templates.
When creating an index, we perform the following:
* Add each component template mapping in order, merging each one in after the
last.
* Merge in the index template mappings (if present).
* Merge in the mappings on the index request itself (if present).
Some principles:
* All 'structural' changes are disallowed (but everything else is fine). An
object mapper can never be changed between `type: object` and `type: nested`. A
field mapper can never be changed to an object mapper, and vice versa.
* Generally, each section is merged recursively. This includes `object`
mappings, as well as root options like `dynamic_templates` and `meta`. Once we
reach 'leaf components' like field definitions, they always overwrite an
existing one instead of being merged.
Relates to #53101.
reason: "index template v2 mapping merging not yet backported to 7.9"
209
+
features: allowed_warnings
210
+
211
+
- do:
212
+
cluster.put_component_template:
213
+
name: red
214
+
body:
215
+
template:
216
+
mappings:
217
+
properties:
218
+
object1.red:
219
+
type: keyword
220
+
object2.red:
221
+
type: keyword
222
+
223
+
- do:
224
+
cluster.put_component_template:
225
+
name: blue
226
+
body:
227
+
template:
228
+
mappings:
229
+
properties:
230
+
object2.red:
231
+
type: text
232
+
object1.blue:
233
+
type: text
234
+
object2.blue:
235
+
type: text
236
+
237
+
- do:
238
+
allowed_warnings:
239
+
- "index template [my-template] has index patterns [baz*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template] will take precedence during new index creation"
Copy file name to clipboardExpand all lines: server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java
0 commit comments