API Overview
Elasticsearch offers many APIs. This section describes some basic APIs. Visit the Elasticsearch official site for complete API information.
Index Operations
Operation |
Description |
|---|---|
PUT /index |
Creates an index. |
DELETE /index |
Deletes an index. |
PUT /index/_doc/id |
Indexes a document. |
POST /index/_doc |
Indexes a document (with an auto-generated ID). |
GET /index/_doc/id |
Retrieves a document. |
DELETE /index/_doc/id |
Deletes a document. |
Search Operations
Operation |
Description |
|---|---|
GET /index/_search |
Searches a document. |
POST /index/_search |
Performs an advanced search. It supports complex query conditions and aggregations. |
Cluster Management
Operation |
Description |
|---|---|
GET /_cluster/health |
Obtains the cluster health status. |
GET /_cluster/state |
Obtains the cluster status. |
POST /_cluster/reroute |
Manually reallocates shards. |
Node Management
Operation |
Description |
|---|---|
GET /_nodes |
Obtains node information. |
GET /_nodes/stats |
Obtains node statistics. |