Clones an existing index Added in 7.4.0
Path parameters
-
Name of the source index to clone.
-
Name of the target index to create.
Query parameters
-
master_timeout string
Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
-
timeout string
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
-
wait_for_active_shards number | string
The number of shard copies that must be active before proceeding with the operation. Set to
all
or any positive integer up to the total number of shards in the index (number_of_replicas+1
).
PUT /{index}/_clone/{target}
curl \
-X PUT http://api.example.com/{index}/_clone/{target} \
-H "Content-Type: application/json" \
-d '"{\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\": {\n \"my_search_indices\": {}\n }\n}"'
Request example
Clone `my_source_index` into a new index called `my_target_index` with `POST /my_source_index/_clone/my_target_index`. The API accepts `settings` and `aliases` parameters for the target index.
{
"settings": {
"index.number_of_shards": 5
},
"aliases": {
"my_search_indices": {}
}
}
Response examples (200)
{
"acknowledged": true,
"index": "string",
"shards_acknowledged": true
}