mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-02-06 07:08:09 +00:00
Signed-off-by: alicejw <alicejw@amazon.com>
This commit is contained in:
parent
5ca9327c97
commit
ed6f8ddd3b
@ -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 /<target-index>/_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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user