Elasticsearch Unique field
No, the _id
is the only field that can have the uniqueness restriction. You probably know this but a new document with existing id would override the existing document with same id. You can use op_type=create
or /my_index/my_type/ID/_create
in order to get back an error if a document with same id already exists.