Introduction
Mapping is the most important concept in ElasticSearch, as it defines how a search engine should process a document.
Search engines are mainly composed of two parts:
Indexing: This action takes a document and stores/indexes/processes it in an index
Searching: This action retrieves the data from the index
These two parts are strictly connected; an error in the indexing step leads to unwanted or missing search results.
ElasticSearch has explicit mapping on an index/type level. When indexing, if mapping is not provided, a default mapping is created, guessing the structure from the data fields that compose the document. Then, this new mapping is automatically propagated to all cluster nodes.
The default type mapping has sensible default values, but when you want to change their behavior you need to provide a new mapping definition.
In this chapter, we'll see all the possible types that compose the mappings.