anchor.diff:  {
       "query": {
           "template": {
  -            "query": {"match_{{template}}": {}},
  +            "id": "my_template", <1>
               "params" : {
  -                "template" : "all"
  +                "query_string" : "all about search"
               }
           }
       }
   }
   ------------------------------------------
  -
  -which is then turned into:
  -
  -[source,js]
  -------------------------------------------
  -{
  -    "query": {
  -        "match_all": {}
  -    }
  -}
  -------------------------------------------
  -
  -You can register a template by storing it in the elasticsearch index `.scripts` or by using the REST API. (See <<search-template>> for more details)
  -In order to execute the stored template, reference it by name in the `query`
  -parameter:
  -
  -
  -[source,js]
  -------------------------------------------
  -GET /_search
  -{
  -    "query": {
  -        "template": {
  -            "query": "templateName", <1>
  -            "params" : {
  -                "template" : "all"
  -            }
  -        }
  -    }
  -}
  -------------------------------------------
  -<1> Name of the the query template stored in the index.
  -
  -[source,js]
  -------------------------------------------
  -GET /_search
  -{
  -    "query": {
  -        "template": {
  -            "query": "storedTemplate", <1>
  -            "params" : {
  -                "template" : "all"
  -            }
  -        }
  -    }
  -}
  -
  -------------------------------------------
  +<1> Name of the the query template in `config/scripts/`, i.e., `storedTemplate.mustache`.
   
   
   There is also a dedicated `template` endpoint, allows you to template an entire search request.
  
positive.code: {
      "query": {
          "template": {
              "query": "{\"match_{{template}}\": {}}\"", <1>
              "params" : {
                  "template" : "all"
              }
          }
      }
  
negative.code: {
      "query": {
          "template": {
              "query": { "match": { "text": "{query_string}" }}},
              "params" : {
                  "query_string" : "all about search"
              }
          }
      }
  