Rate This Document
Findability
Accuracy
Completeness
Readability

API Overview

Elasticsearch offers many APIs. This section describes some basic APIs. Visit the Elasticsearch official site for complete API information.

Index Operations

Table 1 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

Table 2 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

Table 3 Cluster management operations

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

Table 4 Node management operations

Operation

Description

GET /_nodes

Obtains node information.

GET /_nodes/stats

Obtains node statistics.