
Elasticsearch 8.x Cookbook
By :

Mapping is a primary concept in Elasticsearch that defines how the search engine should process a document and its fields to be effectively used in search and aggregations.
Search engines perform the following two main operations:
These two operations are strictly connected; an error in the indexing step leads to unwanted or missing search results.
Elasticsearch, by default, has explicit mapping at the index level. When indexing, if a mapping is not provided, a default one is created and guesses the structure from the JSON data fields that the document is composed of. This new mapping is then automatically propagated to all the cluster nodes: it will begin part of the cluster's state.
The default type mapping has sensible default values, but when you want to change their behavior or customize several other aspects of indexing (object to special fields, storing, ignoring, completion, and so on), you need to provide a new mapping definition.
In this chapter, we'll look at all the possible mapping field types that document mappings are composed of.
In this chapter, we will cover the following recipes: