The Conditional clauses section of the Search template docs include the following note:
... this template is not valid JSON because it includes the section markers like {{#line_no}}. For this reason, the template should either be stored in a file (see Store a search template) or, when used via the REST API, should be written as a string:
However, file scripts were removed with 6.0: https://www.elastic.co/guide/en/elasticsearch/reference/6.0/breaking_60_scripting_changes.html#_file_scripts_removed
The Conditional clauses section of the Search template docs include the following note:
However, file scripts were removed with 6.0: https://www.elastic.co/guide/en/elasticsearch/reference/6.0/breaking_60_scripting_changes.html#_file_scripts_removed