Browse Source

[DOCS] Clarify multi-field addition requires update by query for existing documents (#91541)

* [DOCS] Clarify multi-field addition requires update by query for existing documents

* Update docs/reference/mapping/params/multi-fields.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

* Update docs/reference/indices/put-mapping.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
Anthony McGlone 2 years ago
parent
commit
47e3b89176

+ 5 - 0
docs/reference/indices/put-mapping.asciidoc

@@ -198,6 +198,11 @@ PUT /my-index-000001/_mapping
 You can use the update mapping API to update the `fields` mapping parameter and
 enable multi-fields for an existing field.
 
+WARNING: If an index (or data stream) contains documents when you add a
+multi-field, those documents will not have values for the new multi-field. You
+can populate the new multi-field with the <<picking-up-a-new-property,update by
+query API>>.
+
 To see how this works, try the following example.
 
 Use the <<indices-create-index,create index>> API to create an index with the

+ 5 - 0
docs/reference/mapping/params/multi-fields.asciidoc

@@ -61,6 +61,11 @@ GET my-index-000001/_search
 You can add multi-fields to an existing field using the
 <<indices-put-mapping,update mapping API>>.
 
+WARNING: If an index (or data stream) contains documents when you add a
+multi-field, those documents will not have values for the new multi-field. You
+can populate the new multi-field with the <<picking-up-a-new-property,update by
+query API>>.
+
 A multi-field mapping is completely separate from the parent field's mapping. A
 multi-field doesn't inherit any mapping options from its parent field.
 Multi-fields don't change the original `_source` field.