Elasticsearch Configuring _id autogeneration function

I understand that when you attempt to index an document without specifying an id, Elasticsearch will autogenerate an unique id for your document.

I am wondering if it's possible to configure that id generation function for an existing index? I am hoping that so I can customize the id generation such as attaching a prefix, restricting character rules (like no numbers or hyphens), or use autoincrementing integers instead of strings.

I'd rather avoid using explicit id definition as the documentation explains that inserting a document with explicit id is slower than without explicit id because Elasticsearch would have to look through the index to find existing document with same id to replace.

I imagine that it could be done with _mappings configuration to an index with generator function as a painless script.

No, that is not configurable.

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