GET /_cat/health?v
GET /_cat/indices?v
PUT /{INDEX_NAME}?pretty
PUT /{INDEX_NAME}/{TYPE}/{ID}/pretty
{
"key" : "value"
}
POST /{INDEX_NAME}/{TYPE}/_bulk?pretty
{"index":{"_id":"1"}}
{"name": "John Doe" }
{"index":{"_id":"2"}}
{"name": "Jane Doe" }
This example updates the first document (ID of 1) and then deletes the second document (ID of 2) in one bulk operation:
POST /{INDEX_NAME}/{TYPE}/_bulk?pretty
{"update":{"_id":"1"}}
{"doc": { "name": "John Doe becomes Jane Doe" } }
{"delete":{"_id":"2"}}
Note above that for the delete action, there is no corresponding source document after it since deletes only require the ID of the document to be deleted.
POST localhost:9200/_bulk
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1"} }
{ "doc" : {"field2" : "value2"} }
GET /{INDEX_NAME}/{TYPE}/{ID}?pretty
POST /{INDEX_NAME}/{TYPE}/{ID}?pretty
{
"doc" : { "name" : "Jane Doe" }
}
DELETE /{INDEX_NAME}?pretty