Browse Source

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

James Rodewig 5 years ago
parent
commit
d27c286e9b
1 changed files with 51 additions and 0 deletions
  1. 51 0
      docs/reference/data-streams/change-mappings-and-settings.asciidoc

+ 51 - 0
docs/reference/data-streams/change-mappings-and-settings.asciidoc

@@ -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