# Extra quotes in template query rendering

**URL:** <https://discuss.elastic.co/t/extra-quotes-in-template-query-rendering/37613>\
**Category:** Elasticsearch\
**Created:** [December 19, 2015, 7:20am UTC](https://discuss.elastic.co/t/extra-quotes-in-template-query-rendering/37613 "2015-12-19T07:20:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghasem1992](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@ghasem1992](https://discuss.elastic.co/u/ghasem1992)\
**Post date:** [December 19, 2015, 7:20am UTC](https://discuss.elastic.co/t/extra-quotes-in-template-query-rendering/37613/1 "2015-12-19T07:20:13Z")

</div>

i used a template query like below

`GET /_search/template { "inline": { "size": 20, "explain": false, "query": { "bool": { "should": ["{{#my_field}}", { "dis_max": { "tie_breaker": 0, "queries": [ { "multi_match": { "query": "{{my_value}}", "fields": "{{.}}_*_value^100", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }, { "multi_match": { "query": "{{my_value}}", "fields": "{{.}}_*_value^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 2 } }, { "multi_match": { "query": "{{my_value}}", "fields": "{{.}}_*_nGramValue^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }] } }, "{{/my_field}}" ] } } }, "params": { "my_field": ["1_1", "1_2"], "my_value": "book" } }`

which is rendered as:  
`{ "template_output": { "size": 20, "explain": false, "query": { "bool": { "should": ["", { "dis_max": { "tie_breaker": 0, "queries": [ { "multi_match": { "query": "book", "fields": "1_1_*_value^100", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }, { "multi_match": { "query": "book", "fields": "1_1_*_value^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 2 } }, { "multi_match": { "query": "book", "fields": "1_1_*_nGramValue^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }] } }, "", { "dis_max": { "tie_breaker": 0, "queries": [{ "multi_match": { "query": "book", "fields": "1_2_*_value^100", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }, { "multi_match": { "query": "book", "fields": "1_2_*_value^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 2 } }, { "multi_match": { "query": "book", "fields": "1_2_*_nGramValue^3", "type": "best_fields", "tie_breaker": 0, "fuzziness": 0 } }] } }, "" ] } } } }`

the result has some extra quote ("") and my query does not execute.  
why these quotes are added?

---

<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:29pm UTC](https://discuss.elastic.co/t/extra-quotes-in-template-query-rendering/37613/2 "2017-07-05T23:29:48Z")

</div>


