Elasticsearch

Elasticsearch search engine commands and queries

20 commands
Search & Copy
Save Favorites
20
Total Commands
100%
Free Access
Lightning Fast

Available Commands

Click on any command to copy it instantly

20 commands available
20 of 20
Resources

Master Elasticsearch

Become proficient in Elasticsearch search engine

elasticsearch

Check Cluster Health

Get overall Elasticsearch cluster health

curl -X GET 'http://localhost:9200/_cluster/health?pretty'
elasticsearch
cluster
health
elasticsearch

Cluster Stats

View cluster-wide statistics

curl -X GET 'http://localhost:9200/_cluster/stats?pretty'
elasticsearch
stats
elasticsearch

Node Stats

Get stats for all nodes

curl -X GET 'http://localhost:9200/_nodes/stats?pretty'
elasticsearch
node
stats
elasticsearch

List Indices

List all indices with details

curl -X GET 'http://localhost:9200/_cat/indices?v'
elasticsearch
indices
list
elasticsearch

Create Index

Create a new index

curl -X PUT 'http://localhost:9200/my_index?pretty'
elasticsearch
index
create
elasticsearch

Delete Index

Delete an index

curl -X DELETE 'http://localhost:9200/my_index?pretty'
elasticsearch
index
delete
elasticsearch

Index Document

Insert document into index

curl -X POST 'http://localhost:9200/my_index/_doc/1?pretty' -H 'Content-Type: application/json' -d '{"name":"John"}'
elasticsearch
document
insert
elasticsearch

Get Document

Retrieve document by ID

curl -X GET 'http://localhost:9200/my_index/_doc/1?pretty'
elasticsearch
document
get
elasticsearch

Update Document

Update an existing document

curl -X POST 'http://localhost:9200/my_index/_update/1?pretty' -H 'Content-Type: application/json' -d '{"doc":{"name":"Jane"}}'
elasticsearch
document
update
elasticsearch

Delete Document

Delete a document by ID

curl -X DELETE 'http://localhost:9200/my_index/_doc/1?pretty'
elasticsearch
document
delete
elasticsearch

Search Index

Search documents in an index

curl -X GET 'http://localhost:9200/my_index/_search?q=name:John&pretty'
elasticsearch
search
query
elasticsearch

Search with Body

Perform advanced search with JSON body

curl -X GET 'http://localhost:9200/my_index/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"match":{"name":"John"}}}'
elasticsearch
search
json
elasticsearch

Reindex Data

Copy data from one index to another

curl -X POST 'http://localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d '{"source":{"index":"old_index"},"dest":{"index":"new_index"}}'
elasticsearch
reindex
elasticsearch

Manage Aliases

Add alias to index

curl -X POST 'http://localhost:9200/_aliases?pretty' -H 'Content-Type: application/json' -d '{"actions":[{"add":{"index":"my_index","alias":"current"}}]}'
elasticsearch
alias
elasticsearch

Create Snapshot

Take snapshot of indices

curl -X PUT 'http://localhost:9200/_snapshot/my_backup/snapshot_1?wait_for_completion=true&pretty'
elasticsearch
snapshot
backup
elasticsearch

Restore Snapshot

Restore index from snapshot

curl -X POST 'http://localhost:9200/_snapshot/my_backup/snapshot_1/_restore?pretty'
elasticsearch
snapshot
restore
elasticsearch

Analyze Text

Run analyzer on text

curl -X GET 'http://localhost:9200/_analyze?pretty' -H 'Content-Type: application/json' -d '{"text":"Elasticsearch is awesome"}'
elasticsearch
analyze
text
elasticsearch

Generate Certificates

Generate certificates for security

elasticsearch-certutil cert --ca elastic-stack-ca.p12
elasticsearch
security
cert
elasticsearch

Manage Keystore

Create Elasticsearch keystore

elasticsearch-keystore create
elasticsearch
security
keystore
elasticsearch

Setup Built-in User Passwords

Set passwords for built-in users

elasticsearch-setup-passwords interactive
elasticsearch
security
passwords

Missing a command?

Help us improve this collection by suggesting commands that should be added. Your contributions help the entire developer community!