How to create autoincremented Id (integer) in Elasticsearch?

Hi, I`m interested in how to create autoincremented Id (integer) in Elasticsearch, or maybe someone knows how to create autoincrement field with the script when added a new document into the index?

That is not supported as it is impossible to do so efficiently in a distributed system like Elasticsearch.

If you want that type of identifier you will need to set it yourself before sending the data to Elasticsearch. Be aware this is likely to introduce bottlenecks unless you are ingesting data at a very small scale.

1 Like

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