# Index name , doc say : Cannot be . or .. but run result

**URL:** <https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864>\
**Category:** Elasticsearch\
**Created:** [October 12, 2023, 2:38am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864 "2023-10-12T02:38:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![startjava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/startjava/32/126461_2.png) [@startjava](https://discuss.elastic.co/u/startjava)\
**Post date:** [October 12, 2023, 2:38am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/1 "2023-10-12T02:38:24Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6d02136d54c732fd31a411bbdab7b7badca9dc3a.png)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 12, 2023, 4:19am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/2 "2023-10-12T04:19:34Z")

</div>

Hi @startjava Welcome to the community

Perhaps take a look at the docs you need a valid index name for `PUT /` if that is what you are trying to create, an index, but as the error message tries to explain, there are other methods for that syntax that is valid.

Is valid syntax for the following

```auto
GET /.
HEAD /.
# GET /. 200 OK
{
  "name": "9697c215c241",
  "cluster_name": "docker-cluster",
  "cluster_uuid": "tbRI3CO6TvSYCmR6RDHMvg",
  "version": {
    "number": "8.11.0-SNAPSHOT",
    "build_flavor": "default",
    "build_type": "docker",
    "build_hash": "117cb3b39e713a7856bdfb604c756a4713e8a6d4",
    "build_date": "2023-10-10T21:22:49.722092651Z",
    "build_snapshot": true,
    "lucene_version": "9.8.0",
    "minimum_wire_compatibility_version": "7.17.0",
    "minimum_index_compatibility_version": "7.0.0"
  },
  "tagline": "You Know, for Search"
}
# HEAD /. 200 OK
200 - OK

```

I am not going to run `DELETE /.` 🙂

---

<div class="post-metadata">

**Author:** ![startjava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/startjava/32/126461_2.png) [@startjava](https://discuss.elastic.co/u/startjava)\
**Post date:** [October 12, 2023, 5:59am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/3 "2023-10-12T05:59:44Z")

</div>

hi @stephenb .  
Thank you very much for your guidance, but I'm still not sure.

The document:  
[discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864)  
say:  
Cannot be . or ..

But I use:  
PUT /.

. as index name  
run it，I didn't see the following exception that I was expecting:  
{  
"error": {  
"root\_cause": [  
{  
"type": "invalid\_index\_name\_exception",  
"reason": "Invalid index name [.], must not contain '.'",  
"index\_uuid": "_na_",  
"index": "."  
}  
].  
"type": "invalid\_index\_name\_exception",  
"reason": "Invalid index name [.], must not contain '.'",  
"index\_uuid": "_na_",  
"index": "."  
},  
"status": 400  
}

run result is bottom：  
{  
"error": "Incorrect HTTP method for uri [/?pretty=true] and method [PUT], allowed: [GET, HEAD, DELETE]",  
"status": 405  
}

I am not sure if the index name can be used. Or...

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 12, 2023, 6:08am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/4 "2023-10-12T06:08:51Z")

</div>

`.` alone is not a valid in index name, so not it can not be used.

Can you explain what you're trying to accomplish? Are you just testing ?

Why would you want to name an index Simply a period?

These are both valid.

```auto
PUT /.myindex

#! index name [.myindex] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": ".myindex"
}

PUT /myindex 

```

Ad as the message says from the latest release It turns out, though in 9.X index names starting with `.` will be reserved for system (not user) indices

---

<div class="post-metadata">

**Author:** ![startjava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/startjava/32/126461_2.png) [@startjava](https://discuss.elastic.co/u/startjava)\
**Post date:** [October 12, 2023, 6:26am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/5 "2023-10-12T06:26:37Z")

</div>

I'm just testing to see if the documentation is correct. But it turns out, it's a little mixed.

Although. And.. Always the wrong index name, but it responds to misleading information, can I determine that this is a minor bug?

In other words, the document should be updated to:  
starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices

I am very sorry that I have a problem with document cleanliness. I hope that the es document will be more and more perfect.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 12, 2023, 6:29am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/6 "2023-10-12T06:29:22Z")

</div>

No worries... And no documents are perfect, ours get better over time.

Also in the future it would help if you tell us what version you are on.

---

<div class="post-metadata">

**Author:** ![startjava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/startjava/32/126461_2.png) [@startjava](https://discuss.elastic.co/u/startjava)\
**Post date:** [October 12, 2023, 6:34am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/7 "2023-10-12T06:34:05Z")

</div>

It is suggested to optimize for this situation in the new version of the document, thank you.

elasticsearch version 8.10.2 。  
thanks very much。

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 9, 2023, 6:34am UTC](https://discuss.elastic.co/t/index-name-doc-say-cannot-be-or-but-run-result/344864/8 "2023-11-09T06:34:55Z")

</div>

Closed on November 9, 2023, 6:34am UTC

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