Introduction to Elastic Search

What is Elastic Search, how it works and what it is used for?

Backend developer
Javarevisited
3 min readOct 11, 2021

--

Photo by Agence Olloweb on Unsplash

Elastic Search is like a super-smart computer program that helps you find and understand lots of information really fast. It’s like a super-fast librarian that knows where every book is in a giant library and can tell you what you need in just a snap.

This program was made by some clever folks who used a special tool called Apache Lucene and wrote it in Java. At first, it was just a way to make Lucene even better by making it work on a lot of computers at once.

Elastic Search can handle huge piles of data and find what you want almost instantly, like magic. It does this by using something called an “index” instead of looking through all the information every time.

You can use Elastic Search to find words or phrases in documents, kind of like searching in a big pile of papers instead of a neatly organized filing cabinet. It’s got a lot of tools you can use to put information in and get information out, and it talks to other programs using JSON.

People often use Elastic Search when they’re building websites that only show one page at a time. It’s a really handy tool for finding and showing information quickly.

Components of Elastic Search

  • Index : An index consists of one or more documents
  • Documents : Documents consist of one or more fields
  • Shards : Splits up indices into horizontal pieces called Shards
  • Replica : One or more copy of index

How does Elastic Search works?

The workflow can be explained in brief as follows :

  • Documents are uploaded or stored; they may be of any type and any size and in any number.
  • Then the JSON Builder converts these documents from their respective type to JSON documents.
  • Now, it’s the duty of the Tokenizer, to break down the data into individual words.
  • These words are indexed and mapping is also done so as to group the similar type of words into one mapping type. This ensures the faster retrieval of text as per the query fired by the user.
  • The parser will parse the query and accordingly search and retrieve the searched text from the indexed documents.
Workflow of Elastic Search

Advantages of Elastic Search

  • Scalability : It is scalable across multiple nodes. This means we can start with less number of nodes and in case our workload increases then we can scale across multiple nodes. It is easily scalable.
  • Fast : It is really fast in terms of performance when compared to other search engines that are available.
  • Multilingual : It supports various languages.
  • Document Oriented : Instead of schemas and tables, the data is stored in documents. All the data is stored in JSON format. JSON is the widely accepted web format due to which we can easily integrate the generated output in other applications if required.
  • Auto-completion : It returns documents that contain a specific prefix in a provided field.

Use Cases

There are various applications which use elastic search.

  • Adobe uses elastic stack to make its search smarter with machine learning at scale.
  • T-mobile powers its customer support mobile application with elastic search.
  • HappFresh uses elastic cloud to handle jump in e-commerce traffic in application search.
  • The Warehouse Group uses elastic search to quickly find and validate transactions and refund customers exactly what they paid.

These are the few examples of real-time applications which use elastic search. Due to its various application and easy integration, elastic search is being used by many application. In future posts, we will be using elastic search in designing scalable systems. Stay Tuned. Happy Learning! 🎃

--

--