From ed6f8ddd3b5f3e2bb2f572811fab5ce6eca2a40f Mon Sep 17 00:00:00 2001 From: alicejw Date: Thu, 26 May 2022 14:23:25 -0700 Subject: [PATCH] for doc bug https://github.com/opensearch-project/documentation-website/issues/565 Signed-off-by: alicejw --- _opensearch/rest-api/index-apis/put-mapping.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/_opensearch/rest-api/index-apis/put-mapping.md b/_opensearch/rest-api/index-apis/put-mapping.md index f949f173..bee331d5 100644 --- a/_opensearch/rest-api/index-apis/put-mapping.md +++ b/_opensearch/rest-api/index-apis/put-mapping.md @@ -34,10 +34,25 @@ PUT /sample-index/_mapping ## Path and HTTP methods +The index name is a required path parameter. If you don't specify the index, you will get an error. + ``` PUT //_mapping -PUT /_mapping ``` +For example, to create a mapping for the `sample-index` index, you can make the following call to the mapping API operation: + +``` +PUT /sample-index/_mapping/ +{ + "properties":{ + "year":{ + "type": "text" + } + } +} +``` + +Upon success, you will receive `acknowledged" : true` in the response. You can also use the put mapping operation to update multiple indexes with one request.