Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document index name limitations #30826

Merged
merged 2 commits into from
May 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions docs/reference/indices/create-index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
[[indices-create-index]]
== Create Index

The create index API allows to instantiate an index. Elasticsearch
provides support for multiple indices, including executing operations
across several indices.
The Create Index API is used to manually create an index in Elasticsearch. All documents in Elasticsearch
are stored inside of one index or another.

The most basic command is the following:

[source,js]
--------------------------------------------------
PUT twitter
--------------------------------------------------
// CONSOLE

This create an index named `twitter` with all default setting.

[NOTE]
.Index name limitations
======================================================
There are several limitations to what you can name your index. The complete list of limitations are:

- Lowercase only
- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character), `,`, `#`
- Indices prior to 7.0 could contain a colon (`:`), but that's been deprecated and won't be supported in 7.0+
- Cannot start with `-`, `_`, `+`
- Cannot be `.` or ``..`
- Cannot be longer than 255 characters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually 255 bytes, so multi-byte characters could count towards multiple bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. Fixing


======================================================

[float]
[[create-index-settings]]
=== Index Settings

Each index created can have specific settings
associated with it.
associated with it, defined in the body:

[source,js]
--------------------------------------------------
Expand All @@ -28,25 +51,6 @@ PUT twitter
<1> Default for `number_of_shards` is 1
<2> Default for `number_of_replicas` is 1 (ie one replica for each primary shard)

The above second curl example shows how an index called `twitter` can be
created with specific settings for it using http://www.yaml.org[YAML].
In this case, creating an index with 3 shards, each with 2 replicas. The
index settings can also be defined with http://www.json.org[JSON]:

[source,js]
--------------------------------------------------
PUT twitter
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}
--------------------------------------------------
// CONSOLE

or more simplified

[source,js]
Expand Down