Skip to content

elasticsearch create-index

Create a new elastic search index

Description

Create a new elastic search index

Synopsis

elasticsearch create-index
    [--site <site>]
    [--cluster <cluster>]
    <index>
    [--shards <shards>]
    [--replicas <replicas>]

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 created
     Example: "students"
     Default: _None_      Attributes: required

shards - (int)

     Number of primary shards that an index should have
     Example: --shards 1
     Default: 1      Attributes: optional

replicas - (int)

     Number of replicas
     Example: --replicas 1
     Default: 1      Attributes: optional

Examples

Input:

! elasticsearch create-index --cluster "elastic-1" --shards 4 --replicas 1 "my_source_index"
Output:
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": "class"
}

Access Control

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

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

Please see Access Control for details.