Reputation: 157
I want to generate _id of Elasticsearch document the same way in apache Lucene, to have _id like Elasticsearch but in Apache Lucene. How can I do? Where Can I find algorithm that generate Elasticsearch _id?
Upvotes: 1
Views: 54
Reputation: 217314
The algorithm is based on Flake IDs and can be found here: https://github.com/elastic/elasticsearch/blob/be7c7415627377a1b795400fb8dfcc6cbdf0e322/server/src/main/java/org/elasticsearch/common/TimeBasedUUIDGenerator.java#L49
Upvotes: 2