Elasticsearch 7.13 is there: Software Engineer, Get to Know the Giant of Searching and Analytics.

Elasticsearch, the Giant — Photo by Mick Haupt on Unsplash

What is Elasticsearch?

Have you ever asked yourself how Wikipedia finds the right articles when you type a word or an expression in its search bar?

1- Real-time and full-text search engine

I’ve made some queries in Elasticsearch and got the response in 0 seconds and some microseconds: That’s real-time. Elasticsearch performs advanced queries in an insane timeframe, especially with its cache features. Performing full-text search is its main feature: it can look deeply at each word even letter to give you the most relevant result.

2- NoSQL database

In Elasticsearch, we store data as documents with the flexibility to not follow a real data structure.

4- Analytics tool

Elasticsearch is the core of ELK (Elasticsearch, Logstash, Kibana, and so on) stack, a set of amazing tools among which Kibana. The integration of Elasticsearch and Kibana offers you the power to visualize, process your raw data without worrying about writing one line of code. You can use them to discover relationships among your data using graphs and most importantly, extract insights from Elasticsearch. And the mind-blowing news is its machine learning features.

5- It’s got a RESTFul interface

Imagine that you can query your data from your datastore without any additional third-party API.

Key concepts of Elasticsearch you’ve got to know

Elasticsearch is not only a tool, it’s a technology with its own concepts, its own architecture, and some meanings that are mandatory to know before starting.

1- Index

The first concept we’re going to examine is index. When it comes to describing the data structure Elasticsearch is based upon, users often refer to a comparison with relational databases where an index in Elasticsearch is a database in a relational system but … actually an index is more like a table than a database in a relational context.

  • is a collection of documents that have similar characteristics. It’s the first data structure you have to create before starting storing data. In a news website context, you can have an index for blogs, another for events, another for ads, another for users. Then you can perform your searches against an index.

2- Mapping

Before getting to mapping, let’s talk about schema. A schema defines the structure of a document by describing the type of each field of a document that’s going to be stored in an index.

{
"blogs" : {
"mappings" : {
"properties" : {
},
"title" : {
"type" : "text"
},
"author" : {
"type" : "keyword"
},
"views" : {
"type" : "integer"
},
"created_at" : {
"type" : "date"
}
}
}
}
}

3- Document

In the context of our blogs index, let’s have a look at an example of document:

{
"title" : {
"type" : "Who is the courageous guy that slapped President Macron ?"
},
"author" : {
"type" : "Anonymous"
},
"views" : {
"type" : 50000
},
"created_at" : {
"type" : "2021-06-17"
}

}

4- Elasticsearch as infrastructure

We talked about the key concepts on top of Elasticsearch. What about the underlying layer : Elasticsearch system infrastructure?

  • When your instance of Elasticsearch starts up, it generates a node in the default Elasticsearch cluster.
  • Then you will create an index, for example, blogs index. Your index will be created in this node and will then be spread out across many shards.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store