# Creating search template with client

**URL:** <https://discuss.elastic.co/t/creating-search-template-with-client/21312>\
**Category:** Elasticsearch\
**Created:** [December 18, 2014, 12:26pm UTC](https://discuss.elastic.co/t/creating-search-template-with-client/21312 "2014-12-18T12:26:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benedikt\_Weiner](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@Benedikt\_Weiner](https://discuss.elastic.co/u/Benedikt_Weiner)\
**Post date:** [December 18, 2014, 12:26pm UTC](https://discuss.elastic.co/t/creating-search-template-with-client/21312/1 "2014-12-18T12:26:01Z")

</div>

Hello,

is it possible to create the a search template with the js client.  
I use the official js client:  
[https://github.com/elasticsearch/elasticsearch-js](https://github.com/elasticsearch/elasticsearch-js) and want to create a  
search template described hier:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html)

curl example for creation a search template:  
How is this possible the with the js client?

curl -XPOST "[http://localhost:9200/\_search/template/example](http://localhost:9200/_search/template/example)" -d'  
{  
"template": {  
"query": {  
"match": {  
"title": "{{query\_string}}"  
}  
}  
}  
}'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f0ef7642-3788-4a1a-bd77-43118161baa8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f0ef7642-3788-4a1a-bd77-43118161baa8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Benedikt\_Weiner](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@Benedikt\_Weiner](https://discuss.elastic.co/u/Benedikt_Weiner)\
**Post date:** [December 18, 2014, 1:32pm UTC](https://discuss.elastic.co/t/creating-search-template-with-client/21312/2 "2014-12-18T13:32:10Z")

</div>

found it my self:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Thursday, December 18, 2014 1:26:01 PM UTC+1, Benedikt Weiner wrote:

> Hello,
> 
> is it possible to create the a search template with the js client.  
> I use the official js client:  
> [GitHub - elastic/elasticsearch-js: Official Elasticsearch client library for Node.js](https://github.com/elasticsearch/elasticsearch-js) and want to create a  
> search template described hier:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html)
> 
> curl example for creation a search template:  
> How is this possible the with the js client?
> 
> curl -XPOST "[http://localhost:9200/\_search/template/example](http://localhost:9200/_search/template/example)" -d'  
> {  
> "template": {  
> "query": {  
> "match": {  
> "title": "{{query\_string}}"  
> }  
> }  
> }  
> }'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ac643833-9dcb-47cb-8b1a-2b8797b6d1f3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac643833-9dcb-47cb-8b1a-2b8797b6d1f3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:42am UTC](https://discuss.elastic.co/t/creating-search-template-with-client/21312/3 "2017-07-06T00:42:54Z")

</div>


