anchor.diff:  {
       "query": {
           "template": {
  -            "query": {"match_{{template}}": {}},
  +            "query": { "match": { "text": "{query_string}" }}},
               "params" : {
  -                "template" : "all"
  +                "query_string" : "all about search"
               }
           }
       }
  
positive.code: {
      "query": {
          "template": {
              "query": {"match_{{template}}": {}},
              "params" : {
                  "template" : "all"
              }
          }
      }
  }
  ------------------------------------------
  
  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"
              }
          }
      }
  }
  
  ------------------------------------------
  
  
  There is also a dedicated `template` endpoint, allows you to template an entire search request.
  
negative.code: {
      "query": {
          "template": {
              "file": "my_template", <1>
              "params" : {
                  "query_string" : "all about search"
              }
          }
      }
  }
  ------------------------------------------
  <1> Name of the the query template in `config/scripts/`, i.e., `my_template.mustache`.
  
  Alternatively, you can register a query template in the special `.scripts` index with:
  
  [source,js]
  ------------------------------------------
  PUT /_search/template/my_template
  {
      "template": { "match": { "text": "{query_string}" }}},
  }
  ------------------------------------------
  
  and refer to it in the `template` query with the `id` parameter:
  
  
  [source,js]
  