# Manager document ID in multi process and Elasticsearch

**URL:** <https://discuss.elastic.co/t/manager-document-id-in-multi-process-and-elasticsearch/70911>\
**Category:** Elasticsearch\
**Created:** [January 9, 2017, 3:33am UTC](https://discuss.elastic.co/t/manager-document-id-in-multi-process-and-elasticsearch/70911 "2017-01-09T03:33:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khanh\_Nguy\_n](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@Khanh\_Nguy\_n](https://discuss.elastic.co/u/Khanh_Nguy_n)\
**Post date:** [January 9, 2017, 3:33am UTC](https://discuss.elastic.co/t/manager-document-id-in-multi-process-and-elasticsearch/70911/1 "2017-01-09T03:33:22Z")

</div>

Hi all. I am a newbie in Elasticsearch. I am using Elasticsearch for my system and I want to self define document ids. Each document, I generate a ID like [yearmonthday\_sequence] (example 20170109\_0001) and increase it for new document.  
But my system is mutil process so I confused in manage ID. My approach is search all document in current day and get maximun id and increase when genarate document id but I think it's not reasonable. Do you any solution for manage id for my problem?  
Thank you very much.

---

<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:** [January 9, 2017, 5:59am UTC](https://discuss.elastic.co/t/manager-document-id-in-multi-process-and-elasticsearch/70911/2 "2017-01-09T05:59:28Z")

</div>

You can run an \_update on a "counter" document and get back the document to get the value of the counter.

Like [https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-updates.html#\_updating\_a\_document\_that\_may\_not\_yet\_exist](https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-updates.html#_updating_a_document_that_may_not_yet_exist)

But TBH I'm not a big fan of this. Might work if the number of documents is reasonable but if you are thinking of indexing lot of docs per second this won't work well.

My 2 cents

---

<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:** [February 6, 2017, 5:59am UTC](https://discuss.elastic.co/t/manager-document-id-in-multi-process-and-elasticsearch/70911/3 "2017-02-06T05:59:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
