# Document ID conventions

**URL:** <https://discuss.elastic.co/t/document-id-conventions/5636>\
**Category:** Elasticsearch\
**Created:** [October 19, 2011, 12:16am UTC](https://discuss.elastic.co/t/document-id-conventions/5636 "2011-10-19T00:16:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauri](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Mauri](https://discuss.elastic.co/u/Mauri)\
**Post date:** [October 19, 2011, 12:16am UTC](https://discuss.elastic.co/t/document-id-conventions/5636/1 "2011-10-19T00:16:36Z")

</div>

Hello,

I have not used ES before and am having trouble finding any guidelines  
on what constitutes a valid document ID (that follows the type in  
index and get operations).  
The examples in the guide use numbers while the auto generated IDs are  
base 64 UUIDs based on a 128 bit number.  
Are the document IDS restricted to the string representation of  
numbers or are they arbitrary strings?  
If strings, what characters are allowed (eg I expect a '/' is not  
allowed as it is the delimiter for URIs, any other) ?  
Any other restrictions on what cannot be used for document IDS, such  
as reserved IDs?

Regards  
Mauri

---

<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:** [October 19, 2011, 12:26am UTC](https://discuss.elastic.co/t/document-id-conventions/5636/2 "2011-10-19T00:26:23Z")

</div>

There are not constraints on characters that can be used as the id. Even '/'  
can be used, though you might need to escape it, for example, id of value  
"1/2" will be passes like this:

curl -XPUT localhost:9200/test/type1/1%2F2 -d '{  
"field" : "value"  
}'

On Wed, Oct 19, 2011 at 2:16 AM, Mauri [mauri@proactive-edge.com.au](mailto:mauri@proactive-edge.com.au) wrote:

> Hello,
> 
> I have not used ES before and am having trouble finding any guidelines  
> on what constitutes a valid document ID (that follows the type in  
> index and get operations).  
> The examples in the guide use numbers while the auto generated IDs are  
> base 64 UUIDs based on a 128 bit number.  
> Are the document IDS restricted to the string representation of  
> numbers or are they arbitrary strings?  
> If strings, what characters are allowed (eg I expect a '/' is not  
> allowed as it is the delimiter for URIs, any other) ?  
> Any other restrictions on what cannot be used for document IDS, such  
> as reserved IDs?
> 
> Regards  
> Mauri

---

<div class="post-metadata">

**Author:** ![Mauri](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Mauri](https://discuss.elastic.co/u/Mauri)\
**Post date:** [October 19, 2011, 12:34am UTC](https://discuss.elastic.co/t/document-id-conventions/5636/3 "2011-10-19T00:34:36Z")

</div>

Thankyou Shay, Just the answer I was hoping for.

---

<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:51am UTC](https://discuss.elastic.co/t/document-id-conventions/5636/4 "2017-07-06T03:51:25Z")

</div>


