Basics of ElasticSearch And Its Components

Posted By : Vikrant Joshi | 31-Dec-2021



Elastic search is an analytics and search engine which is open source and distributed. It is developed in Java language and built on Apache Lucene. It allows you to store, search, and analyze large amounts of data faster and even in milliseconds. It is able to receive such a fast response because rather than searching the data directly it searches for its index. It uses a structure based on documents rather than database schemas. You can just imagine Elastic Search of a server receiving a json request aand responding back with a json response.

How Does Elasticsearch Work?

Let's now understand how elastic search organizes data.


Document is the unit of information which can be expressed as JSON data. You can just imagine it like a row in a database associated with an entity. A document here is more than a text; it can be encoded Json data. This data can be string,numbers, text, date. Each one of the documents is associated with a unique id and a data type which is used to define what kind of entity it is.


An index is a collection of multiple documents which are alike in characteristics. It is an entity which is used to query against in Elasticsearch. An index is almost similar to a database in a database schema. For example in an e-commerce website there can be an index for sellers, buyers, products , orders etc. An index is being identified by a name which is used to refer to it while performing operations like searching, indexing, update , delete .

Inverted Index

An inverted index in elasticsearch is actually an index. It is a structure which stores a mapping from data, such as words , numbers , to its location in a document or even in a list of documents. Basically it is a map-like structure with a key value pair that directs us from a word to a document. It does not hold the string directly and rather splits each document up to particular search terms and then binds this term to documents those search terms occur within.


A group of multiple nodes connected together in an elasticsearch forms a cluster. This cluster is very beneficial in distributing the task, performing operations like searching , indexing across all over the nodes of the cluster.


It is part of a cluster serving as a single server. It stores data and takes part in operations like indexing and searching. A node in elastic search can be configured in following of the three given ways.

Master Node — Master node or main node is used to control the Elasticsearch cluster and is solely responsible for all the operations that happen cluster-wide like creating and deleting an index and adding or removing nodes.

Data Node — Data node is used to store data and is used to execute data-related operations such as search etc.

Client Node — It is used to pass on the cluster requests to the master node or main node and data-related requests to following data nodes.


Elasticsearch provides the capability to further divide the index into multiple pieces , these are known as shards. A shard in itself is represented as an independent index and which can further act as a node in a cluster. By such mechanism elasticsearch provides redundancy against any loss like hardware failure and also increases the query capacity.


A replica is just a copy of anything , elasticsearch has the ability to provide a replica shard which is a copy of the original shard . Every index in elasticsearch belongs to an original shard. Replicas project us against any failure like hardware failure which could lead us to loss of data and increases the elasticsearch operations capability also.

We are an ERP development company that specializes in building custom enterprise solutions for the diverse industries-specific needs of our clients. Our team has vast experience in using open-source software platforms like Odoo, OFBiz, ERPNext, and Opentaps to build custom ERP applications from the ground up. To learn more about our custom ERP software development services, contact us at [email protected].