Getting Started with Elastic Search
Background
Elasticsearch is a distributed, open-source search and analytics engine designed for handling large amounts of data quickly and in near real-time. It is built on top of the Apache Lucene search library, which is a high-performance, full-featured text search engine library written in Java.
Elasticsearch is widely used for full-text search, structured search, analytics, and logging. It is commonly used in combination with other tools, such as Logstash for data ingestion and Kibana for data visualization, to create a complete stack for data analysis and exploration.
Below fig shows the flow of using an elastic search
The below fig shows the usage of elastic search with kibana for analysis report.
Elasticsearch is a powerful, open-source, full-text search and analytics engine. It can be used to index, search, and analyze large volumes of data quickly and in near real-time. Here are the steps you can follow to get started with Elasticsearch:
Install Elasticsearch: You can download and extract Elasticsearch on your local machine or on a server. The installation process is straightforward
Start the Elasticsearch server: After extracting Elasticsearch, click the Elasticsearch.bat to start the server or run the elasticsearch
command in the terminal.
elasticsearch-8.5.3 bin/elasticsearch.bat
Verify Elasticsearch is running: To verify that Elasticsearch is running by sending an HTTP request to the Elasticsearch API. Open a web browser and navigate to http://localhost:9200
. If Elasticsearch is running.
Use a similar process for Kibana by following with elastic search to start the server using powershell or terminal.
kibana-8.5.3 bin/kibana.bat
Performing CRUD operations
Create a document
Using put to create automated indexing using elastic search, besides if use Post can be used to create unique identifiers for example patient id.
PUT Name-of-the-Index
POST Name-of-the-Index
POST favorite_candy/_doc
{
"first_name": "Maaz",
"candy": "KITKAT"
}
Read a document
GET Name-of-the-Index/_doc/id-of-the-document-you-want-to-retrieve
GET favorite_candy/_doc/1
Update a document
If you want to update fields in a document, use the following syntax:
POST favorite_candy/_update/1
{
"doc": {
"candy": "M&M's"
}
}
Delete a document
DELETE favorite_candy/_doc/1
Congratulations! now you understand the basics of elastic search to use locally.