Introduction
In this new series, we will discuss about Elastic Search. This search Engine developed in Java is now very popular. It provides a distributed search engine with an HTTP Interface and schema-free JSON documents. Let’s see the fundamentals together !
Overview
Elastic is based on Lucene Library which is a free search engine software library and has a lot of great features :
- First, Elastic Search is distributed and can be scaled horizontally.
- Then it provides REST APIs for communicating with other programming languages (Java, .NET, PHP, Python etc.) and can be used by customers for their own developments.
- Finally, Elastic Search is easy to use !
Elastic Search grew with 3 others products called Logstash, Beats and Kibana which are known together as the “Elastic Stack”
- Kibana is an open source data visualization and exploration tool from that is specialized for large volumes of streaming and real-time data.
- Logstash is a data collection engine that unifies data from disparate sources, normalizes it and distributes it.
- Beats are “data shippers” that are installed on servers as agents used to send different types of operational data to Elasticsearch either directly or through Logstash, where the data might be enhanced or archived.
- ElasticSearch, as already explained, the search engine.
Here is an example of an ELK Stack architecture :
CRUD Operations (Create, Read, Update, Delete)
Elasticsearch supports storing documents in JSON format on which basic operations can be performed.
- Create or Update : In Elasticsearch terminology, adding (or creating) a document into a type within an index of Elasticsearch is called an indexing operation. We will use for that the Indexing API with commands PUT (updates) or POST (creations).
- Read : The Get API is useful for retrieving a document when you already know the ID of the document.
- Delete : The Delete API is used to delete Indexes.
There is also a Bulk API which makes it possible to run multiple operations in a single API Call. It will be also faster to use it !
Data and Search
There are basically two types of data :
- Static (like a catalog)
- Dynamic (i.e logs)
Elastic Search works great with both of them !
We want for example be able to make research on a website content AND web logs for different goals.
There are basically two main ways to search :
- queries (i.e What movies have the word “love” in the title ?)
- aggregations (i.e What are the top movies ?)
Kibana, the visualization tool, will relie on Elasticsearch to execute queries and aggregations.
Search example :
GET movies/_search { "query": { "match": { "actor": "Brad Pitt" } } }
By default, a search request with Elasticsearch will return the first 10 hits.
That’s all for today ! See you in a next lecture on Queries 🙂
Sources :
https://searchitoperations.techtarget.com
Wikipedia