Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the rules for index names in Elastic Search?

What is limit length of index name? and what are characters that can use in index name?

Thanks in advance.

like image 246
J.Done Avatar asked Jan 11 '17 07:01

J.Done


People also ask

What is index name in Elasticsearch?

In Elasticsearch, an index (plural: indices) contains a schema and can have one or more shards and replicas. An Elasticsearch index is divided into shards and each shard is an instance of a Lucene index. Indices are used to store the documents in dedicated data structures corresponding to the data type of fields.

What is index and type in Elasticsearch?

In RDBMS terms, index is a database and type can be a table which contains many rows( document in elasticsearch). You could have a different index maintaining user information, with the "name", "age" and other such fields generally attributed to a person, and a different one for blogs with "createdAt", "content", etc.


1 Answers

If you try to create an index with a name whose length exceeds 255 characters (or ~100 UTF-8 encoded bytes) you'll get an error like this one

InvalidIndexNameException[Invalid index name [...], index name is too long, (266 > 255)] 

As for the valid characters to use in an index, the best place to look for is in their test suite, but basically an index name

  • must not contain the characters #, \, /, *, ?, ", <, >, |, ,
    • Since ES 7.0 onwards, : is not allowed as well
  • must not start with _, - or +
  • must not be . or ..
  • must be lowercase
like image 193
Val Avatar answered Sep 29 '22 14:09

Val