Skip to content
El

Elasticsearch

Cluster health, index lifecycle, document APIs, and snapshot management.

10 commandssearchobservabilityrest-api

Command catalog

Cluster infoElasticsearch

GET _cluster/health

Check overall cluster health, status, and shard information.

curl -X GET "http://<host>:9200/_cluster/health?pretty"
Cluster infoElasticsearch

GET _cat/nodes

Return a concise table of nodes, roles, and resource usage.

curl -X GET "http://<host>:9200/_cat/nodes?v"
Index lifecycleElasticsearch

PUT <index>

DELETE <index>

Create indices with mappings or remove them entirely.

curl -X PUT "http://<host>:9200/<index>?pretty" -H 'Content-Type: application/json' -d '{"settings":{"number_of_shards":1,"number_of_replicas":1}}'
Index lifecycleElasticsearch

PUT <index>/_mapping

PUT <index>/_settings

Update mappings or adjust index settings after creation.

curl -X PUT "http://<host>:9200/<index>/_mapping?pretty" -H 'Content-Type: application/json' -d '{"properties":{"user":{"type":"keyword"}}}'
Document operationsElasticsearch

POST <index>/_doc

PUT <index>/_doc/<id>

Index new documents with autogenerated or explicit IDs.

curl -X POST "http://<host>:9200/<index>/_doc?pretty" -H 'Content-Type: application/json' -d '{"user":"alice","message":"hello world"}'
Document operationsPUT <index>/_doc/<id>searchobservabilityrest-api
View command
Document operationsElasticsearch

POST <index>/_update/<id>

Perform partial updates or scripted transforms on documents.

curl -X POST "http://<host>:9200/<index>/_update/<id>?pretty" -H 'Content-Type: application/json' -d '{"doc":{"status":"processed"}}'
Document operationsElasticsearch

POST <index>/_search

Run search queries with filters, aggregations, and pagination.

curl -X POST "http://<host>:9200/<index>/_search?pretty" -H 'Content-Type: application/json' -d '{"query":{"match":{"message":"<keywords>"}}}'
Maintenance and snapshotsElasticsearch

GET _cat/indices

List indices with size, docs count, and health indicators.

curl -X GET "http://<host>:9200/_cat/indices?v"
Maintenance and snapshotsElasticsearch

POST _reindex

Copy documents between indices for migrations or transformations.

curl -X POST "http://<host>:9200/_reindex?pretty" -H 'Content-Type: application/json' -d '{"source":{"index":"<source>"},"dest":{"index":"<target>"}}'
Maintenance and snapshotsElasticsearch

PUT _snapshot/<repo>/<snapshot>

GET _snapshot

Create and inspect snapshots for disaster recovery.

curl -X PUT "http://<host>:9200/_snapshot/<repo>/<snapshot>?wait_for_completion=true" -H 'Content-Type: application/json' -d '{"indices":"<index>","ignore_unavailable":true}'
Maintenance and snapshotsGET _snapshotsearchobservabilityrest-api
View command