MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Understanding Elasticsearch Index Mapping & Schema

A schema is a description of one or more fields that describes the document type and how to handle the different fields of a document.

The schema in Elasticsearch is a mapping that describes the the fields in the JSON documents along with their data type, as well as how they should be indexed in the Lucene indexes that lie under the hood. Because of this, in Elasticsearch terms, we usually call this schema a “mapping”.

  • Conceptually, an Elasticsearch server contains zero or more indexes.
  • An index is a container for zero or more types, which in turn has zero or more documents. To put it another way: a document has an identifier, belongs to a type, which belongs to an index.
  • Elasticsearch is multi-tenant, by which we mean that a single server can store multiple indexes and multiple types.
  • Elasticsearch has the ability to be schema-less, which means that documents can be indexed without explicitly providing a schema.
  • If you do not specify a mapping, Elasticsearch will by default generate one dynamically when detecting new fields in documents during indexing.
  • However, this dynamic mapping generation comes with a few caveats:Detected types might not be correct, May lead to unnecessary duplication

Index layout diagram: documents mapped to types inside Index 1 and Index 2 on an Elasticsearch node
Mapping Type
Each index has one mapping type which determines how the document will be indexed. A mapping type has:

  1. Meta-fields  – Meta-fields are used to customize how a document’s metadata associated is treated. Examples of meta-fields include the document’s _index, _type, _id, and _source fields.
  2. Fields or properties – A mapping type contains a list of fields or properties pertinent to the document.

Fields datatypes
Each field has a data type which can be:

  • a simple type like text, keyword, date, long, double, boolean or ip.
  • a type which supports the hierarchical nature of JSON such as object or nested.
  • or a specialised type like geo_point, geo_shape, or completion.

Diagram of index my_index holding my_type documents and another_type, beside a separate index

Diagram linking a document to its index, fields and mapping type, which leads to a mapping definition

Elasticsearch example mapping: PUT my_index with title, name, age and created field types

Reference

  • https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html#_field_datatypes
  • https://www.wikitechy.com/tutorials/elasticsearch/elasticsearch-mapping

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How to install & configure Elastic Filebeat?

Filebeat client is a lightweight, resource-friendly tool that collects logs from files on the server and forwards these logs to your Logstash instance for processing. Filebeat is…

Read More

Install and Configure Elasticsearch: Step by Step Guide

Install and Configure Elasticsearch in Linux Download and Extract Elasticsearch Run and Verify Elasticsearch 9.3 Run and Verify Elasticsearch 7.x Run and Verify Elasticsearch 8.x Run and…

Read More

Staff Search Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

A **Staff Search Engineer** is a senior individual contributor who designs, builds, and evolves enterprise-grade search and retrieval capabilities that power product discovery, navigation, and information access across a company’s applications and data surfaces. The role blends **information retrieval (IR), search platform engineering, relevance/ranking optimization, distributed systems, and rigorous measurement** to deliver consistently high-quality results under real-world latency, reliability, and scale constraints.

Read More

Senior Search Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

A **Senior Search Engineer** designs, builds, and continuously improves the search and retrieval capabilities of a software product—ensuring users can reliably find the right content, products, documents, or answers with high relevance, low latency, and strong operational stability. The role blends software engineering, information retrieval (IR), data engineering, and production operations to deliver search experiences that are measurably effective and resilient at scale.

Read More

Search Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

A Search Engineer designs, builds, and operates the search and retrieval capabilities that power how users discover content, products, documents, or data within an application or platform. This role focuses on relevance, ranking, query performance, indexing pipelines, and observability—ensuring search results are accurate, fast, and resilient at scale.

Read More

Principal Search Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Principal Search Engineer is a senior individual contributor responsible for the architecture, relevance, performance, and operational excellence of a company’s search and retrieval capabilities across products and internal platforms. This role combines deep information retrieval (IR) expertise with distributed systems engineering to deliver fast, reliable, and high-quality search experiences at scale.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x