[role="xpack"] [[ilm-shrink]] === Shrink Phases allowed: warm Sets an index to <> and shrinks it into a new index with fewer primary shards. The name of the new index is of the form `shrink-`. For example, if the name of the source index is _logs_, the name of the shrunken index is _shrink-logs_. The shrink action allocates all primary shards of the index to one node so it can call the <> to shrink the index. After shrinking, it swaps aliases that point to the original index to the new shrunken index. [IMPORTANT] If the shrink action is used on a <>, policy execution waits until the leader index rolls over (or is <>), then converts the follower index into a regular index with the <> before performing the shrink operation. [[ilm-shrink-options]] ==== Shrink options `number_of_shards`:: (Required, integer) Number of shards to shrink to. Must be a factor of the number of shards in the source index. [[ilm-shrink-ex]] ==== Example [source,console] -------------------------------------------------- PUT _ilm/policy/my_policy { "policy": { "phases": { "warm": { "actions": { "shrink" : { "number_of_shards": 1 } } } } } } --------------------------------------------------