- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 126字
- 2021-06-24 14:52:19
How to do it...
The HTTP method to get a mapping is GET. The URL formats to get mappings are as follows:
- http://<server>/_mapping
- http://<server>/<index_name>/_mapping
To get a mapping from an index, we will perform the following steps:
- If we consider the mapping for the previous recipe, the call will be as follows:
GET /myindex/_mapping?pretty
The pretty argument in the URL is optional, but very handy to print the response output prettily .
- The result returned by Elasticsearch should be as follows:
{
"myindex" : {
"mappings" : {
"properties" : {
"customer_id" : {
"type" : "keyword",
"store" : true
},
"date" : {
"type" : "date"
},
... truncated ...,
"vat" : {
"type" : "double",
"index" : false
}
}
}
}
}