[DOCS] Add write_index_only param to ds mapping tutorials (#59618) (#59639)

This commit is contained in:
James Rodewig 2020-07-15 13:02:01 -04:00 committed by GitHub
parent 67e7c3f60e
commit ef9b14b07e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,29 @@ PUT /logs/_mapping
}
----
====
+
To add the mapping only to the stream's write index, set the put mapping API's
`write_index_only` query parameter to `true`.
+
.*Example*
[%collapsible]
====
The following put mapping request adds the new `message` field mapping only to
the `logs` stream's write index. The new field mapping is not added to the
stream's other backing indices.
[source,console]
----
PUT /logs/_mapping?write_index_only=true
{
"properties": {
"message": {
"type": "text"
}
}
}
----
====
[discrete]
[[change-existing-field-mapping-in-a-data-stream]]
@ -214,6 +237,34 @@ PUT /logs/_mapping
}
----
====
+
To apply the mapping changes only to the stream's write index, set the put mapping API's
`write_index_only` query parameter to `true`.
+
.*Example*
[%collapsible]
====
The following put mapping request changes the `host.ip` field's mapping only for
the `logs` stream's write index. The change is not applied to the stream's other
backing indices.
[source,console]
----
PUT /logs/_mapping?write_index_only=true
{
"properties": {
"host": {
"properties": {
"ip": {
"type": "ip",
"ignore_malformed": true
}
}
}
}
}
----
====
Except for supported mapping parameters, we don't recommend you change the
mapping or field data type of existing fields, even in a data stream's matching