--- "Template search request": - do: index: index: test type: testtype id: 1 body: { "text": "value1" } - do: index: index: test type: testtype id: 2 body: { "text": "value2" } - do: indices.refresh: {} - do: search_template: body: { "template" : { "query": { "term": { "text": { "value": "{{template}}" } } } }, "params": { "template": "value1" } } - match: { hits.total: 1 } - do: search_template: body: { "template" : { "query": { "match_{{template}}": {} } }, "params" : { "template" : "all" } } - match: { hits.total: 2 }