Why can't an index start with an uppercase letter?


(Chua Chee Wee) #1

I'm testing out my learning of the ElasticSearch project, and found out that indices cannot start with an uppercase letter.

When I attempted to create an index with an uppercase letter, I get a HTTP 400 response.
If I attempted to create the same index, but starting with a lowercase letter, I get a HTTP 200 response.

I tried searching the docs, but I don't see anything that talks about this. Did I miss something?


(David Pilato) #2

What is the error, the exact command and your OS, versions...


(Chua Chee Wee) #3

Hi David,

I've developed my own client using the Delphi/Pascal language.

Using Windows 2008 R2 SP1.
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

I also tested using curl like so:
curl -XPUT http://localhost:9200/Delphi

The error I got was:
{"error":{"root_cause":[{"type":"invalid_index_name_exception","reason":"Invalid index name [Delphi], must be lowercase","index_uuid":"na","index":"Delphi"}],"type":"invalid_index_name_exception","reason":"Invalid index name [Delphi], must be lowercase","index_uuid":"na","index":"Delphi"},"status":400}


(David Pilato) #4

So yes the index name must be lowercased.


(Chua Chee Wee) #5

David, the question is why, not "Does the index have to be lowercased".


(Christian Dahlqvist) #6

I agree it is not called out clearly in the documentation, and had to search a bit before finding it in the Definitive Guide.

I suspect the reason is due to the fact that the index name historically used to be present as directory names under the data directory. As Elasticsearch can be deployed on file systems that are case-insensitive, this means that case sensitive index names would not work.


(David Pilato) #7

Yeah. I agree that now things changed we could potentially support it again.
Not sure if it's really worth it TBH.


(Chua Chee Wee) #8

Thanks for responding, David and Christian!

Much appreciated!


(system) #9

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.