Skip to content

elasticsearch split-index

Split an existing index

Description

Splits an existing index into a new index with more primary shards

Synopsis

elasticsearch split-index
    [--site <site>]
    [--cluster <cluster>]
    <index>
    --target_index <target_index>
    --shards <shards>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of elastic search cluster
     Example: --cluster "elastic-default"
     Default: elastic-default      Attributes: optional

index - (string)

     Name of the index to be split
     Example: "students"
     Default: _None_      Attributes: required

target_index - (string)

     Name for the split index. This shouldn't already exist in the cluster
     Example: --target_index "students-split"
     Default: _None_      Attributes: required

shards - (int)

     Primary shard count in target index. It must be higher and a multiple of source index primary shards
     Example: --shards 1
     Default: _None_      Attributes: required

Examples

Input:

! elasticsearch split-index "my_source_index" --shards 2 --target_index "split_index_1"
Output:
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": "splittestingindex"
}

Access Control

To use this command, you need access to the following:

Field Value
Action "update"
Service Type "elasticsearch"
Service Instance cluster
Namespace
Object Type "index"
Object ID index

Please see Access Control for details.