Index configurations are usually automatically specified by Elasticsearch. we can define our own index configurations to have an understanding of our data to be indexed. There are two configurations we can define for a particular index.
Mapping is the process of defining or specifying how a document, and the fields it contains, are stored and indexed in an index. Basically, It is a process of defining the schema of an index. For instance, use mappings to define:
►Mapping types :
There are two types of mappings in Elasticsearch.
Meta-fields are used to define how a document’s metadata associated is treated. Examples of meta-fields include the document’s _index, _type, _id, and _source fields.
►Fields or Properties
Properties contain a list of fields and their characteristics.
►Field datatypes :
text, keyword, long, date, double, Boolean, IP, nested, geo_point, geo_shape, completion.
You can index string fields like text & keyword with the standard analyzer, English analyzer, simple analyzer or any other analyzer as well.
“analyzer”: ”standard” },
“type”: “date” },
“type”: “double” },
“type”: “double” }
You can configure shards, replicas, custom analyzers and many more settings related to an Index which we’re going to store in ElasticSearch.
Here, we are defining how many shards, replicas we want and our own custom analyzer for a index BankAccountDetails PUT /BankAccountDetails/_settings
} } } }