Skip to content
Index lifecycleElasticsearch

PUT <index>

PUT <index>DELETE <index>

Create indices with mappings or remove them entirely.

Command
curl -X PUT "http://:9200/?pretty" -H 'Content-Type: application/json' -d '{"settings":{"number_of_shards":1,"number_of_replicas":1}}'

Example usage

Provision indices with custom settings or delete obsolete ones.

curl -X PUT "http://<host>:9200/<index>?pretty" -H 'Content-Type: application/json' -d '{"settings":{"number_of_shards":1,"number_of_replicas":1}}'
curl -X DELETE "http://<host>:9200/<index>?pretty"

Related tags

Index lifecycleDELETE <index>searchobservabilityrest-api