# Creating search template targeting a specific index

**URL:** <https://discuss.elastic.co/t/creating-search-template-targeting-a-specific-index/179447>\
**Category:** Elasticsearch\
**Created:** [May 3, 2019, 1:38am UTC](https://discuss.elastic.co/t/creating-search-template-targeting-a-specific-index/179447 "2019-05-03T01:38:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rennishj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rennishj/32/42172_2.png) [@rennishj](https://discuss.elastic.co/u/rennishj)\
**Post date:** [May 3, 2019, 1:38am UTC](https://discuss.elastic.co/t/creating-search-template-targeting-a-specific-index/179447/1 "2019-05-03T01:38:28Z")

</div>

Hi, I am using ES(6.7) search templates to support my queries from as [asp.net](http://asp.net) application at work . Our DEV and QA share the same ES nodes(Total 2 nodes). We name our indices dev-\* and qa-\* to identify each index b/w Dev and QA. The searchtemplate api documentaion doesn't specify an option to give an index name while creating a template here [https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search-template.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search-template.html). We have some 30 search templates in DEV. So Is my only option is to create separate templates targeting DEV and QA? I know while invoking a search template from the code(NEST), we have to specify the index name, but if I am working on an enhancement in DEV that requires an update to an existing search template, that will break the search in QA that uses the same template. Please let me know if there is a better approach.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 31, 2019, 1:38am UTC](https://discuss.elastic.co/t/creating-search-template-targeting-a-specific-index/179447/2 "2019-05-31T01:38:30Z")

</div>

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