Getting a mapping
After having set our mappings for processing types, we sometimes need to control or analyze the mapping to prevent issues. The action to get the mapping for a type helps us to understand the structure or its evolution due to some merge and explicit type guessing.
Getting ready
You need a working ElasticSearch cluster and the mapping created in the previous recipe.
How to do it...
The HTTP method to get a mapping is GET.
The URL formats for getting mapping are as follows:
http://<server>/_mapping
http://<server>/<index_name>/_mapping
http://<server>/<index_name>/<type_name>/_mapping
For getting a mapping from in an index, we need to perform the following steps:
If we consider the type order of the previous chapter, the call will be as follows:
curl -XGET 'http://localhost:9200/myindex/order/_mapping?pretty=true'
The result returned by ElasticSearch should be as follows:
{ "order": { "properties": { "customer_id": { ...