Generate ID


(Raunak) #1

I understand that ids are automatically generated if one is not provided. After reading this blog post, it seems using Java's UUID is not the best choice. Is there a way to use Elastic's internal id generator in my Java code?


Externalize Elasticsearch UUID generator
(Lee Hinman) #2

Unfortunately the code is not separated into a separate dependency, if you want to use it you will need to depend on Elasticsearch itself and use org.elasticsearch.common.Strings.base64UUID() to generate a time-based UUID.


(Raunak) #3

Thanks @dakrone. That worked like a charm.
I'm already using the ElasticSearch Java library, so there is no additional dependency for me to add.


(system) #4