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.
Values are
-1
or0
. - timeout
string Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Values are
-1
or0
. - 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
).Values are
all
orindex-setting
.
PUT /{index}/_shrink/{target}
Console
POST /my_source_index/_shrink/my_target_index
{
"settings": {
"index.routing.allocation.require._name": null,
"index.blocks.write": null
}
}
resp = client.indices.shrink(
index="my_source_index",
target="my_target_index",
settings={
"index.routing.allocation.require._name": None,
"index.blocks.write": None
},
)
const response = await client.indices.shrink({
index: "my_source_index",
target: "my_target_index",
settings: {
"index.routing.allocation.require._name": null,
"index.blocks.write": null,
},
});
response = client.indices.shrink(
index: "my_source_index",
target: "my_target_index",
body: {
"settings": {
"index.routing.allocation.require._name": nil,
"index.blocks.write": nil
}
}
)
$resp = $client->indices()->shrink([
"index" => "my_source_index",
"target" => "my_target_index",
"body" => [
"settings" => [
"index.routing.allocation.require._name" => null,
"index.blocks.write" => null,
],
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"settings":{"index.routing.allocation.require._name":null,"index.blocks.write":null}}' "$ELASTICSEARCH_URL/my_source_index/_shrink/my_target_index"
Request example
{
"settings": {
"index.routing.allocation.require._name": null,
"index.blocks.write": null
}
}