Create index
While you can create an index by using a document as a base, you can also create an empty index for use later.
The following example demonstrates how to create an index with a non-default number of primary and replica shards, specifies that is of type integer
, and assigns a sample-alias1
alias to the index.
PUT <index-name>
- All letters must be lowercase.
- Index names can’t begin with underscores (
_
) or hyphens (-
).
As part of your request, you can supply parameters in your request’s body that specify index settings, mappings, and for your newly created index. The following sections provide more information about index settings and mappings.
Index settings are separated into two varieties: static index settings and dynamic index settings. Static index settings are settings that you specify at index creation and can’t change later. You can change dynamic settings at any time, including at index creation.