{
  "id": "elasticsearch/search-template-parsing-error",
  "signature": "ElasticsearchParseException: failed to parse search template [my_template]; error: Mustache syntax error at line 3: unexpected character '}'",
  "signature_zh": "Elasticsearch解析异常：无法解析搜索模板 [my_template]；错误：第3行Mustache语法错误：意外的字符 '}'",
  "regex": "failed to parse search template \\[([^\\]]+)\\]; error: Mustache syntax error at line \\d+",
  "domain": "elasticsearch",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A search template defined in Elasticsearch contains invalid Mustache syntax, such as mismatched braces or incorrect variable interpolation, causing template parsing to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "Elasticsearch中定义的搜索模板包含无效的Mustache语法，例如不匹配的花括号或错误的变量插值，导致模板解析失败。",
  "versions": [
    {
      "version": "7.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Re-saving the template with the same invalid syntax will produce the same error; the template must be corrected first.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Clearing the search template cache via POST /_cache/clear does not fix the underlying template definition.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Retrieve the template definition using GET /_scripts/my_template, fix the Mustache syntax (e.g., replace unmatched '}' with '{{/query}}'), and update it using PUT /_scripts/my_template with the corrected source. Example fix: change '{{#query}} {{field}} }' to '{{#query}} {{field}} {{/query}}'.",
      "success_rate": 0.95,
      "how": "Retrieve the template definition using GET /_scripts/my_template, fix the Mustache syntax (e.g., replace unmatched '}' with '{{/query}}'), and update it using PUT /_scripts/my_template with the corrected source. Example fix: change '{{#query}} {{field}} }' to '{{#query}} {{field}} {{/query}}'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use an inline template in the search query instead of a stored template to bypass the parsing issue temporarily: GET /_search/template { 'source': { 'query': { 'match': { 'field': '{{value}}' } } }, 'params': { 'value': 'test' } }",
      "success_rate": 0.8,
      "how": "Use an inline template in the search query instead of a stored template to bypass the parsing issue temporarily: GET /_search/template { 'source': { 'query': { 'match': { 'field': '{{value}}' } } }, 'params': { 'value': 'test' } }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Retrieve the template definition using GET /_scripts/my_template, fix the Mustache syntax (e.g., replace unmatched '}' with '{{/query}}'), and update it using PUT /_scripts/my_template with the corrected source. Example fix: change '{{#query}} {{field}} }' to '{{#query}} {{field}} {{/query}}'.",
    "Use an inline template in the search query instead of a stored template to bypass the parsing issue temporarily: GET /_search/template { 'source': { 'query': { 'match': { 'field': '{{value}}' } } }, 'params': { 'value': 'test' } }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-03-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}