# How to detect which index template Elasticsearch will use before an index creation

DevFeed: [How to detect which index template Elasticsearch will use before an index creation](<https://devfeed.tech/articles/how-to-detect-which-index-template-elasticsearch-will-use-before-an-index-creation-78787.md>)

Original publisher: [Read original article](<https://www.elastic.co/search-labs/blog/elasticsearch-index-template>)

Author: Musab Dogan

Published: 2024-05-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Elasticsearch Labs](<https://devfeed.tech/sources/elasticsearch-labs.md>)

Topics: [elasticsearch](<https://devfeed.tech/topics/elasticsearch.md>), [Elastic Cloud](<https://devfeed.tech/topics/elastic-cloud.md>)

Tags: [elasticsearch](<https://devfeed.tech/tags/elasticsearch.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [index-data](<https://devfeed.tech/tags/index-data.md>)

## AI overview

This tutorial explains how Elasticsearch legacy, composable, and component index templates work and how to determine which template will apply when an index is created. It describes using the `_simulate_index` API for composable templates and checking elected master node logs when that API returns an empty body. It also covers template precedence, overlap, and risks such as unexpected mappings that can break applications.

## Source excerpt

Learn about Elasticsearch index templates and how to detect which index template Elasticsearch will use before creating the index itself.