โ† Elasticsearch learning path
Elasticsearch ยท Module 3 of 10

Indexes, documents and mappings

A mapping defines each field's type, like a schema.

๐Ÿ“– Key ideas

  1. PUT /products/_doc/1 with a JSON body stores a document.
  2. GET /products/_doc/1 reads it back.
  3. Mappings set field types: text, keyword, integer, date, boolean.
  4. Dynamic mapping guesses types, but explicit mappings avoid surprises.
  5. You cannot change a field's type in place; you reindex into a new index.
๐Ÿ’ก Real-life example: Like the column headings on an admission form: they decide what goes in each box before anyone fills it.
MappingThe schema of an index
Dynamic mappingElasticsearch guesses field types
ReindexCopy documents into a new index
_docThe endpoint for single documents