The documentation of elastic search states:
The index operation can be executed without specifying the id. In such a case, an id will be generated automatically.
But it does not provide any information about the properties of the ids.
22
.[-_A-Za-z0-9]
Each document has an _id that uniquely identifies it, which is indexed so that documents can be looked up either with the GET API or the ids query. The _id can either be assigned at indexing time, or a unique _id can be generated by Elasticsearch. This field is not configurable in the mappings.
Elasticsearch will store the id as a String even if your mapping says otherwise: "mappings": { "properties": { "id": { "type": "integer" }, That is my mapping, but when I do a sort on _id I get documents ordered as: 10489, 10499, 105, 10514...
Auto-generated ids are random base64-encoded UUIDs. The base64 algorithm is used in URL-safe mode hence -
and _
characters might be present in ids.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With