Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Crash Course of Elasticsearch in 10 mins

What is Elasticsearch?
Elasticsearch is fast, horizontally scalable open source search engine. It provides HTTP API for storing and indexing JSON documents and with default configuration it behaves a little bit like searchable NoSQL database.

Installation – RHEL/Centos

Install and Configure Elasticsearch: Step by Step Guide

Check node’s health status:
$ curl 127.0.0.1:9200/_cat/health?v

Get list of current indices
$ curl 127.00.1:9200/_cat/indices?v

Understanding Elasticsearch Keywords and Terminology

Understanding Elasticsearch Keywords and Terminology

CRUD Operations using RESTful API of Elasticsearch using Create, Read, Update, Delete

[code]

Create – Adding new document to elasticsearch is as easy as HTTP POST request:
$ curl -X POST 127.0.0.1:9200/monitor/logs?pretty -d ‘{
“kind”: “info”,
“message”: “The server is up and running”
}’
#{
# “_index” : “monitor”,
# “_type” : “logs”,
# “_id” : “AVoWblBE6fU5oFCNC7jY”,
# “_version” : 1,
# “result” : “created”,
# “_shards” : {
# “total” : 2,
# “successful” : 1,
# “failed” : 0
# },
# “created” : true
#}

As not many people would actually enjoy inserting documents one by one, there’s also bulk insert option.

$ curl -X POST 127.0.0.1:9200/monitor/logs/_bulk -d ‘
{ “index”: {}}
{ “kind” : “warn”, “message”: “Using 90% of memory” }
{ “index”: {}}
{ “kind”: “err”, “message”: “OutOfMemoryException: Epic fail has just happened” }

Read – when we have something in the index, we can perform simple search to read the documents back.

curl 127.0.0.1:9200/monitor/_search?pretty
#{
# ………
# “hits” : {
# “total” : 3,
# “max_score” : 1.0,
# “hits” : [
# {
# “_index” : “monitor”,
# “_type” : “logs”,
# “_id” : “AVoWe_7d6fU5oFCNC7jb”,
# “_score” : 1.0,
# “_source” : {
# “kind” : “err”,
# “message” : “OutOfMemoryException: Epic fail has just happened”
# }
# },
# {
# “_index” : “monitor”,
# “_type” : “logs”,
# “_id” : “AVoWe_7d6fU5oFCNC7ja”,
# “_score” : 1.0,
# “_source” : {
# “kind” : “warn”,
# “message” : “Using 90% of memory”
# }
# },
# {
# “_index” : “monitor”,
# “_type” : “logs”,
# “_id” : “AVoWblBE6fU5oFCNC7jY”,
# “_score” : 1.0,
# “_source” : {
# “kind” : “info”,
# “message” : “The server is up and running”
# }
# }
# ]
# }
#}

It’s also possible to get single document by its ID:

curl 127.0.0.1:9200/monitor/logs/AVoWblBE6fU5oFCNC7jY?pretty
#{
# …
# “_source” : {
# “kind” : “info”,
# “message” : “The server is up and running”
# }
#}

Update – Similarly, knowing document ID we can update it.

$ curl -X POST 127.0.0.1:9200/monitor/logs/AVoWe_7d6fU5oFCNC7jb -d ‘
{ “kind”: “err”,
“message”: “OutOfMemoryException: The server process used all available memory”
}’

Delete – When you need to get rid of something, HTTP DELETE will do the trick. E.g.
$ curl -X DELETE 127.0.0.1:9200/monitor/logs/AVoWe_7d6fU5oFCNC7jb

Search – The real power of elasticsearch is in search (duh). There’re two approaches for searching for data: the REST Request API for simple queries and more sophisticated Query DSL.

$ curl -s 127.0.0.1:9200/monitor/_search?q=memory | json_pp
$ curl -s 127.0.0.1:9200/monitor/_search -d ‘

[/code]

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

How to install & configure Elastic Filebeat?

Filebeat client is a lightweight, resource-friendly tool that collects logs from files on the server and forwards these logs to your Logstash instance for processing. Filebeat is…

Read More

Install and Configure Elasticsearch: Step by Step Guide

Install and Configure Elasticsearch in Linux Download and Extract Elasticsearch Run and Verify Elasticsearch 9.3 Run and Verify Elasticsearch 7.x Run and Verify Elasticsearch 8.x Run and…

Read More

About Elastic (The Company)

Certainly! Here’s a detailed overview of Elastic N.V. (commonly known as Elastic, the company behind Elasticsearch), covering its transformation, history, key milestones, product evolution, and major release…

Read More

How to install kibana and configure with Elasticsearch

Download & Extract kibana 8.x Configure kibana 8.x Download, Extract, Install and Configure kibana 9.x vi config/kibana.yml ./bin/kibana –allow-root Provide Enrollment Kye of ElasticSearch Login to Kibana…

Read More

Aws Tutorials: FinOps – List of all Elasticcache cost optimization strategies

Here’s a table summarizing the cost optimization strategies for Amazon ElastiCache: Strategy Description Right-Sizing Instances Select instance types that match workload requirements. Use smaller nodes for development…

Read More

AWS Tutorials: Difference between Amazon Elasticsearch Service and Amazon Elastic cache Service

Here is a comparison table highlighting the differences between Amazon Elasticsearch Service (now known as Amazon OpenSearch Service) and Amazon ElastiCache Service: Feature/Aspect Amazon OpenSearch Service Amazon…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x