
Elastic Developer Cheatsheet
Cheatsheet for Elastic Developer
Introduction This is a quick cheat sheet from Sematext’s Elastic Developer Cheatsheet
Data Manipulation Put/Get/Delete index curl -XPUT localhost:9200/index-name -d '{"settings": { "number_of_shards": 1}}' curl -XGET localhost:9200/index-name?pretty curl -XDELETE localhost:9200/index-name Put/Get/Delete template curl -XPUT localhost:9200/_template/template-name -d '{ "template": "logs*", "mappings": { "foo-type": { "properties": { "foo-field": { "type": "text" } } } }, "settings": { "number_of_shards": 1 } }' curl -XGET localhost:9200/_template/template-name?pretty curl -XDELETE localhost:9200/_template/template-name Bulk API echo '{"index": { "_index": "logs01", "_type": "logs"}} {"title": "this is an error"} {"index": { "_index": "logs02", "_type": "logs"}} {"title": "this is a warning"} {"delete": { "_index": "logs03", "_type": "logs", "_id": "abc123"}} ' > /tmp/bulk curl localhost:9200/_bulk?