# Able to Sort result from SearchTemplate request

**URL:** <https://discuss.elastic.co/t/able-to-sort-result-from-searchtemplate-request/32002>\
**Category:** Elasticsearch\
**Created:** [October 12, 2015, 11:00am UTC](https://discuss.elastic.co/t/able-to-sort-result-from-searchtemplate-request/32002 "2015-10-12T11:00:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trycoon](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@trycoon](https://discuss.elastic.co/u/trycoon)\
**Post date:** [October 12, 2015, 11:00am UTC](https://discuss.elastic.co/t/able-to-sort-result-from-searchtemplate-request/32002/1 "2015-10-12T11:00:03Z")

</div>

I don't know if I'm missing something but there doesn't seem to be a way to sort the result of a searchTemplate execution: [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html).

The normal search-function takes a "sort"-parameter to specify on which field the results should be sorted: [https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search)

But the searchTemplate-function are missing the sort-parameter: [https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate)

Is this correct?? It does limit the usefulness of the searchTemplate-function a lot.

---

<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, 11:45pm UTC](https://discuss.elastic.co/t/able-to-sort-result-from-searchtemplate-request/32002/2 "2017-07-05T23:45:24Z")

</div>


