In RDBMS analogy, mapping means defining a table schema. We always define a table structure, that is, column data types. In Elasticsearch, we also need to define the data type for each field. But then comes another question. Why did we not define it before when we ingested three documents into the my_index index? The answer is simple. Elasticsearch doesn't care. It is claimed that Elasticsearch is a schema-less data model.
If we don't define a mapping, Elasticsearch dynamically creates a mapping for us by defining all fields as text. Elasticsearch is intelligent enough to find out date fields to assign the date data type to them.
Let's find the existing dynamic mapping of index my_index:
curl -XGET 'localhost:9200/my_index2/_mapping/?pretty'
Response:
{
"my_index" : {
"mappings" : {
customer" : {
"properties" : {
...