# Illegal chars in doc id

**URL:** <https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196>\
**Category:** Elasticsearch\
**Created:** [August 19, 2011, 12:10am UTC](https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196 "2011-08-19T00:10:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrg](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mrg](https://discuss.elastic.co/u/mrg)\
**Post date:** [August 19, 2011, 12:10am UTC](https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196/1 "2011-08-19T00:10:16Z")

</div>

am looking to create (index) a documents with base-64 chars that include slashes.  
ES reliably returns http. 400 🙂

What is the preferred work-around when this is the case? In this context, am using this as Doc ID and will not be searching on it; rather just as a nosql key lookup.

thanks in advance!

-gleeco

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 19, 2011, 4:30am UTC](https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196/2 "2011-08-19T04:30:51Z")

</div>

How are you indexing it? Escaping it should work.

On Fri, Aug 19, 2011 at 3:10 AM, gleeco [gleeco@gmail.com](mailto:gleeco@gmail.com) wrote:

> am looking to create (index) a documents with base-64 chars that include  
> slashes.  
> ES reliably returns http. 400 🙂
> 
> What is the preferred work-around when this is the case? In this context,  
> am  
> using this as Doc ID and will not be searching on it; rather just as a  
> nosql  
> key lookup.
> 
> thanks in advance!
> 
> -gleeco
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/illegal-chars-in-doc-id-tp3266673p3266673.html](http://elasticsearch-users.115913.n3.nabble.com/illegal-chars-in-doc-id-tp3266673p3266673.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![mrg](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mrg](https://discuss.elastic.co/u/mrg)\
**Post date:** [August 19, 2011, 6:02am UTC](https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196/3 "2011-08-19T06:02:18Z")

</div>

indeed- just wanted to get verification that adding a key should use URI escaping.  
Everything works fine w/ escaping: docids --and doctype too.  
And for index names, the error message is self-evident:

{"error": ".. must not contain the following characters [\, /, \*, ?, ", \<, \>, |, , ,]]","status":400}

thanks!

---

<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 6, 2017, 3:56am UTC](https://discuss.elastic.co/t/illegal-chars-in-doc-id/5196/4 "2017-07-06T03:56:36Z")

</div>


