From 5050cb6f4ab8f9bfb2a41a9bec9bead84288eac7 Mon Sep 17 00:00:00 2001 From: Arnoldas Grigutis Date: Fri, 10 Mar 2023 19:55:43 +0200 Subject: [PATCH 1/2] Update put-mapping.md: add an example for "dynamic": "strict" in index mapping JSON --- _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 7bf9b243e74..443699f1a62 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 + +### Field "dynamic" + +To enforce document structure to match the structure of the index mapping, specify property "dynamic" and set its value to "strict": + +```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: From 9cce35d278033a17f47a38d8d1485f7fea1c071a Mon Sep 17 00:00:00 2001 From: Aria Marble <111301581+ariamarble@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:38:45 -0700 Subject: [PATCH 2/2] Apply suggestions from code review --- _api-reference/index-apis/put-mapping.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_api-reference/index-apis/put-mapping.md b/_api-reference/index-apis/put-mapping.md index 443699f1a62..ec6e0b1b690 100644 --- a/_api-reference/index-apis/put-mapping.md +++ b/_api-reference/index-apis/put-mapping.md @@ -42,9 +42,9 @@ The request body must contain `properties`, which has all of the mappings that y ## Optional request body fields -### Field "dynamic" +### dynamic -To enforce document structure to match the structure of the index mapping, specify property "dynamic" and set its value to "strict": +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 {