Search code examples
elasticsearchsearchelasticsearch-6

Are IDs guaranteed to be unique across indices in Elasticsearch 6+?


With mapping types being removed in Elasticsearch 6.0 I wonder if IDs of documents are guaranteed to be unique across indices?

Say I have three indices, all with a "parent" field that contains an ID. Do I need to include which index the ID belongs to or can I just search through all three indices when looking for a document with the given ID?


Solution

  • IDs are not unique across indices. If you want to refer to a document you need to know both the index name and the ID.