1.Cluster Health
GET /_cat/health?v
List All Indices
GET /_cat/indices?v
Create an Index
PUT /customer?pretty
GET /_cat/indices?v
Index and Query a Document
PUT /customer/_doc/1?pretty
{
"name": "John Doe"
}
GET /customer/_doc/1?pretty
Delete an Index
DELETE /customer?pretty
GET /_cat/indices?v
Updating Documents
POST /customer/_doc/1/_update?pretty
{
"doc": { "name": "Jane Doe", "age": 20 }
}
Deleting Documents
DELETE /customer/_doc/2?pretty
Batch Processing
POST /customer/_doc/_bulk?pretty
{"index":{"_id":"1"}}
{"name": "John Doe" }
{"index":{"_id":"2"}}
{"name": "Jane Doe" }
POST /customer/_doc/_bulk?pretty
{"update":{"_id":"1"}}
{"doc": { "name": "John Doe becomes Jane Doe" } }
{"delete":{"_id":"2"}}
Exploring Your Data
curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_doc/_bulk?pretty&refresh" --data-binary "@accounts.json"
curl "localhost:9200/_cat/indices?v"
The Search API
GET /bank/_search?q=*&sort=account_number:asc&pretty
Here is the same exact search above using the alternative request body method: GET /bank/_search { "query": { "match_all": {} }, "sort": [ { "account_number": "asc" } ] }