# How to use template in elastic search

**URL:** <https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519>\
**Category:** Elasticsearch\
**Created:** [September 14, 2016, 3:02pm UTC](https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519 "2016-09-14T15:02:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swapnil\_Shah](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Swapnil\_Shah](https://discuss.elastic.co/u/Swapnil_Shah)\
**Post date:** [September 14, 2016, 3:02pm UTC](https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519/1 "2016-09-14T15:02:38Z")

</div>

Can I get syntax to implement template in elastic search ?

I have tried using following but no success

var templateRequest= new PutSearchTemplateDescriptor(new Id("my\_template"));

templateRequest.Template("{"multi\_match":{"query":{"query":"{{suggestion}}","fields":["field1","field2"]}}}");

var response = ElasticClient.PutSearchTemplate(templateRequest);

---

<div class="post-metadata">

**Author:** ![Kallem\_Prathyusha](https://avatars.discourse-cdn.com/v4/letter/k/258eb7/32.png) [@Kallem\_Prathyusha](https://discuss.elastic.co/u/Kallem_Prathyusha)\
**Post date:** [September 14, 2016, 3:23pm UTC](https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519/2 "2016-09-14T15:23:06Z")

</div>

@Swapnil_Shah Hi,Could you please specify which client you are using and what version?

---

<div class="post-metadata">

**Author:** ![prasperl](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@prasperl](https://discuss.elastic.co/u/prasperl)\
**Post date:** [September 14, 2016, 4:02pm UTC](https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519/3 "2016-09-14T16:02:34Z")

</div>

@Kallem_Prathyusha We are using the latest version of NEST .net client.We figured out putsearchtemplate is probably a wrong method to call. but not sure what is the right way to call a registered template from NEST client.Any examples would be immensely helpful

---

<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:** [July 5, 2017, 10:20pm UTC](https://discuss.elastic.co/t/how-to-use-template-in-elastic-search/60519/4 "2017-07-05T22:20:10Z")

</div>


