# ElasticSearch DocumentId

**URL:** <https://discuss.elastic.co/t/elasticsearch-documentid/21396>\
**Category:** Elasticsearch\
**Created:** [December 26, 2014, 2:18pm UTC](https://discuss.elastic.co/t/elasticsearch-documentid/21396 "2014-12-26T14:18:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhimanyu\_Nagrath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhimanyu_nagrath/32/48724_2.png) [@Abhimanyu\_Nagrath](https://discuss.elastic.co/u/Abhimanyu_Nagrath)\
**Post date:** [December 26, 2014, 2:18pm UTC](https://discuss.elastic.co/t/elasticsearch-documentid/21396/1 "2014-12-26T14:18:14Z")

</div>

Hi I am new to elastic search I want to know that how does elastic search  
maintain the doc\_id field for each document .and can we manually give the  
doc\_id while indexing and document?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1688b053-3fd9-47d5-a291-8ad3faa6fc05%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1688b053-3fd9-47d5-a291-8ad3faa6fc05%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 26, 2014, 4:18pm UTC](https://discuss.elastic.co/t/elasticsearch-documentid/21396/2 "2014-12-26T16:18:25Z")

</div>

Each doc has an \_id. It could be autogenerated when using POST index/type or set at index time using PUT index/type/id

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 26 déc. 2014 à 15:18, Abhimanyu Nagrath [abhimanyunagrath@gmail.com](mailto:abhimanyunagrath@gmail.com) a écrit :
> 
> ## Hi I am new to Elasticsearch I want to know that how does Elasticsearch maintain the doc\_id field for each document .and can we manually give the doc\_id while indexing and document?
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1688b053-3fd9-47d5-a291-8ad3faa6fc05%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1688b053-3fd9-47d5-a291-8ad3faa6fc05%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/675FE005-9CEF-4588-BB1F-E8CA412DE131%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/675FE005-9CEF-4588-BB1F-E8CA412DE131%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![sandeep\_kaushal\_verm](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sandeep\_kaushal\_verm](https://discuss.elastic.co/u/sandeep_kaushal_verm)\
**Post date:** [December 26, 2014, 8:30pm UTC](https://discuss.elastic.co/t/elasticsearch-documentid/21396/3 "2014-12-26T20:30:09Z")

</div>

yes you can in my case i use userId as doc\_id

On Friday, 26 December 2014 19:48:14 UTC+5:30, Abhimanyu Nagrath wrote:

> Hi I am new to Elasticsearch I want to know that how does Elasticsearch  
> maintain the doc\_id field for each document .and can we manually give the  
> doc\_id while indexing and document?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/eea5f111-8030-4e47-b5c2-0db92502321f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eea5f111-8030-4e47-b5c2-0db92502321f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:41am UTC](https://discuss.elastic.co/t/elasticsearch-documentid/21396/4 "2017-07-06T00:41:52Z")

</div>


