Registering search templates with conditionals via REST API


How is it possible to pre-register a search template with conditionals via
REST API in version 1.3.4?

When I try to use the example template from
I get a JsonParseException.

So the example template looks like:

POST /_search/template/test
"template": {
"query": {
"filtered": {
"query": {
"match": {
"line": "{{text}}"
"filter": {
"range": {
"line_no": {
"gte": "{{start}}"
"lte": "{{end}}"

Do I have to use a mustache file for that?

Thanks in advance

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
To view this discussion on the web visit
For more options, visit