# Character support in Document Id

**URL:** <https://discuss.elastic.co/t/character-support-in-document-id/61682>\
**Category:** Elasticsearch\
**Created:** [September 28, 2016, 10:00am UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682 "2016-09-28T10:00:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankitnaudiyal](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Ankitnaudiyal](https://discuss.elastic.co/u/Ankitnaudiyal)\
**Post date:** [September 28, 2016, 10:00am UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682/1 "2016-09-28T10:00:23Z")

</div>

Hi Team,

I'm trying to index a tweet with author name as the Document Id. We have a requirement which requires us to have some names with special characters like @ symbol. After some trials it seems that it is not possible to use @ symbol in the Id field. PFB an example which I tried and got an error in response.  
POST Twitter/tweet/@sheldon?refresh  
{  
"text":"Tweeting"  
}

I faced same problem with # symbol as well, could not use an id with # in  
I'm trying to look for resources which can help me with this problem. From a lot of documentations and responses from people it seems that Elastic does not restrict any characters in the Id field. I'm very surprised to experience this behavior.  
Could someone provide their inputs on this?

---

<div class="post-metadata">

**Author:** ![ctvisani](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@ctvisani](https://discuss.elastic.co/u/ctvisani)\
**Post date:** [September 28, 2016, 12:17pm UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682/2 "2016-09-28T12:17:15Z")

</div>

I am able to create id with @ symbol but not able to create Id with # character it creates random generated id with #.

---

<div class="post-metadata">

**Author:** ![Ankitnaudiyal](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Ankitnaudiyal](https://discuss.elastic.co/u/Ankitnaudiyal)\
**Post date:** [September 29, 2016, 4:07am UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682/3 "2016-09-29T04:07:47Z")

</div>

Hi Chintan,  
Could you provide me a sample how you are able to use @ in the id field. I've not been able to use it using the above posted request.

---

<div class="post-metadata">

**Author:** ![ctvisani](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@ctvisani](https://discuss.elastic.co/u/ctvisani)\
**Post date:** [September 29, 2016, 5:14am UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682/4 "2016-09-29T05:14:55Z")

</div>

I am using head plugin to add into id field.

​

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/6d3fd3dc71a4741ff4442ec67ee2c50d0e54e08c.jpg)

---

<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:** [July 5, 2017, 10:16pm UTC](https://discuss.elastic.co/t/character-support-in-document-id/61682/5 "2017-07-05T22:16:19Z")

</div>


