Elastic search ids that are generated by the system look like this.
"_id": "AU9HiR3lEVul15o3bNYl"
What format is that? Also does anyone know of a library to generate ids like that?
Elastic search ids that are generated by the system look like this.
"_id": "AU9HiR3lEVul15o3bNYl"
What format is that? Also does anyone know of a library to generate ids like that?
Before v1.4.0 elasticsearch was using UUID-based ids. These ids were Base64 encoded version of a Version 4.0-compatible UUID as defined by RFC4122. In order to encode the ids an URL-safe Base64 encoding was used (see section 4 of RFC3548) and the last two "=" signs were removed (because Base64 encoding of 16 bytes would always generate two "=" at the end).
Unfortunately, completely random ids were less then ideal from performance perspective. So, starting with version 1.4.0 elasticsearch switched to time-based ids. The new id format is essentially a version of flake ids except it is using 6 (not 8) bytes for timestamp and 3 (not 2) bytes for the sequence number.
The id in the question AU9HiR3lEVul15o3bNYl
looks like a time-base id that was generated somewhere in the middle of Aug 2015.
Autogenerated IDs are 22 character long, URL-safe, Base64-encoded string universally unique identifiers, or UUIDs, although it looks like your ID is 20 characters.
Some more .NET info here I think, looks like Guid.NewGuid will work. What is the string length of a GUID?