# Disable id creation?

**URL:** <https://discuss.elastic.co/t/disable-id-creation/5154>\
**Category:** Elasticsearch\
**Created:** [August 13, 2011, 7:51pm UTC](https://discuss.elastic.co/t/disable-id-creation/5154 "2011-08-13T19:51:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [August 13, 2011, 7:51pm UTC](https://discuss.elastic.co/t/disable-id-creation/5154/1 "2011-08-13T19:51:11Z")

</div>

I haven't been able to find a way to tell ES to use the \_id property in my  
source instead of auto-generating one.

I think my use case justifies a need for this. I write all of my indexed  
JSON objects to S3 for backup purposes. When I read these files out of S3, I  
read them into a byte array and I would like to directly index these values.  
However, if I create my IndexRequest without specifying an index, I was  
hoping that ES would use the \_id value from my source. Instead, ES generates  
a new id and compares it to my source's id and tells me there is a mismatch.

Is there an option to change this behavior?

---

<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 14, 2011, 7:58pm UTC](https://discuss.elastic.co/t/disable-id-creation/5154/2 "2011-08-14T19:58:19Z")

</div>

elasticsearch needs to know the id in order to control the routing of the  
document indexed to a shard. It can, potentially, do that for you (and parse  
it twice), or you can do it yourself. Open an issue to allow for a mapping  
setting to "search" for the id (something like id path, similar in nature to  
routing path).

On Sat, Aug 13, 2011 at 10:51 PM, James Cook [jcook@tracermedia.com](mailto:jcook@tracermedia.com) wrote:

> I haven't been able to find a way to tell ES to use the \_id property in my  
> source instead of auto-generating one.
> 
> I think my use case justifies a need for this. I write all of my indexed  
> JSON objects to S3 for backup purposes. When I read these files out of S3, I  
> read them into a byte array and I would like to directly index these values.  
> However, if I create my IndexRequest without specifying an index, I was  
> hoping that ES would use the \_id value from my source. Instead, ES generates  
> a new id and compares it to my source's id and tells me there is a mismatch.
> 
> Is there an option to change this behavior?

---

<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:57am UTC](https://discuss.elastic.co/t/disable-id-creation/5154/3 "2017-07-06T03:57:03Z")

</div>


