{
  "id": "elasticsearch/geo-shape-indexing-error",
  "signature": "MapperParsingException: failed to parse geo_shape field [location] - expected [point] but found [polygon]",
  "signature_zh": "MapperParsingException: 解析 geo_shape 字段 [location] 失败 - 期望 [point] 但找到 [polygon]",
  "regex": ".*failed to parse geo_shape field.*expected.*but found.*",
  "domain": "elasticsearch",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "The index mapping defines the field as a point type, but the indexed document contains a polygon or other geometry type, causing a parsing mismatch.",
  "root_cause_type": "generic",
  "root_cause_zh": "索引映射将字段定义为点类型，但索引文档包含多边形或其他几何类型，导致解析不匹配。",
  "versions": [
    {
      "version": "7.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.0.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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The mapping must explicitly define the geometry type (e.g., 'point', 'polygon') for validation. Omitting it can lead to unexpected behavior or performance issues.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This loses spatial precision and may not be acceptable for queries that require exact geometry. It also requires code changes.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is disruptive to production and may cause data loss if not backed up. It also doesn't fix the immediate indexing error.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Update the mapping to accept multiple geometry types by setting `'ignore_malformed': true` for the field: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"ignore_malformed\": true } } }",
      "success_rate": 0.85,
      "how": "Update the mapping to accept multiple geometry types by setting `'ignore_malformed': true` for the field: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"ignore_malformed\": true } } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Change the mapping to the correct geometry type (e.g., polygon) and reindex: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"orientation\": \"right\" } } }",
      "success_rate": 0.9,
      "how": "Change the mapping to the correct geometry type (e.g., polygon) and reindex: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"orientation\": \"right\" } } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a pipeline to transform the geometry before indexing: PUT _ingest/pipeline/geo_transform { \"processors\": [ { \"geo_shape\": { \"field\": \"location\", \"target_field\": \"location\", \"shape_type\": \"polygon\" } } ] }",
      "success_rate": 0.8,
      "how": "Use a pipeline to transform the geometry before indexing: PUT _ingest/pipeline/geo_transform { \"processors\": [ { \"geo_shape\": { \"field\": \"location\", \"target_field\": \"location\", \"shape_type\": \"polygon\" } } ] }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Update the mapping to accept multiple geometry types by setting `'ignore_malformed': true` for the field: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"ignore_malformed\": true } } }",
    "Change the mapping to the correct geometry type (e.g., polygon) and reindex: PUT my_index/_mapping { \"properties\": { \"location\": { \"type\": \"geo_shape\", \"orientation\": \"right\" } } }",
    "Use a pipeline to transform the geometry before indexing: PUT _ingest/pipeline/geo_transform { \"processors\": [ { \"geo_shape\": { \"field\": \"location\", \"target_field\": \"location\", \"shape_type\": \"polygon\" } } ] }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.87,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}