From eead5ecf29e718edfb47e3294159f70da2b49d49 Mon Sep 17 00:00:00 2001 From: Arnoldas Grigutis Date: Thu, 16 Mar 2023 18:42:13 +0200 Subject: [PATCH] Update put-mapping.md: add "dynamic" (#3384) * Update put-mapping.md: add an example for "dynamic": "strict" in index mapping JSON * Apply suggestions from code review --------- Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com> --- _api-reference/index-apis/put-mapping.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/_api-reference/index-apis/put-mapping.md b/_api-reference/index-apis/put-mapping.md index 7bf9b243..ec6e0b1b 100644 --- a/_api-reference/index-apis/put-mapping.md +++ b/_api-reference/index-apis/put-mapping.md @@ -40,6 +40,23 @@ The request body must contain `properties`, which has all of the mappings that y } ``` +## Optional request body fields + +### dynamic + +You can make the document structure match the structure of the index mapping by setting the `dynamic` request body field to `strict`, as seen in the following example: + +```json +{ + "properties":{ + "dynamic": "strict", + "color":{ + "type": "text" + } + } +} +``` + ## Optional query parameters Optionally, you can add query parameters to make a more specific request. For example, to skip any missing or closed indexes in the response, you can add the `ignore_unavailable` query parameter to your request as follows: