# MapperParsingException: failed to parse geo_shape field [location] - expected [point] but found [polygon]

- **ID:** `elasticsearch/geo-shape-indexing-error`
- **Domain:** elasticsearch
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 87%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.10.0 | active | — | — |
| 7.17.0 | active | — | — |
| 8.0.0 | active | — | — |
| 8.7.0 | active | — | — |

## Workarounds

1. **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 } } }** (85% success)
   ```
   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 } } }
   ```
2. **Change the mapping to the correct geometry type (e.g., polygon) and reindex: PUT my_index/_mapping { "properties": { "location": { "type": "geo_shape", "orientation": "right" } } }** (90% success)
   ```
   Change the mapping to the correct geometry type (e.g., polygon) and reindex: PUT my_index/_mapping { "properties": { "location": { "type": "geo_shape", "orientation": "right" } } }
   ```
3. **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" } } ] }** (80% success)
   ```
   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" } } ] }
   ```

## Dead Ends

- **** — The mapping must explicitly define the geometry type (e.g., 'point', 'polygon') for validation. Omitting it can lead to unexpected behavior or performance issues. (50% fail)
- **** — This loses spatial precision and may not be acceptable for queries that require exact geometry. It also requires code changes. (30% fail)
- **** — This is disruptive to production and may cause data loss if not backed up. It also doesn't fix the immediate indexing error. (60% fail)
