Manager document ID in multi process and Elasticsearch

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.

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


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

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