Disable automatic ID generation on OpenSearch

When indexing a document OpenSearch has the option to perform a POST to the index/_doc API for creating it, automatically generating an document ID if not informed.

Is there a configuration option to disable it, making so the only option is to explicitly inform a document ID when creating?

Hi @sousu,

You could use PUT instead of POST, which, by the looks of it, is enforcing you to provide an _id value:

Best,
mj

is there an option to disable the POST endpoint? My issue is how to enforce it so no other member on my team can introduce a mistake unknowingly.

Well, enforcing the PUT operation may be a path, but an option to disable it like the “action.auto_create_index=false” that disables index autocreation would be nice. I have sent a suggestion on github.

[Feature Request] Option to disable automatic ID generation · Issue #16939 · opensearch-project/OpenSearch