Skip to content

ignore_malformed doesn't always work for invalid geoJSON #31428

@Lumaraf

Description

@Lumaraf

Elasticsearch version:
6.2.3

JVM version:
1.8.0_161

OS version
Debian 4.9.30-2+deb9u2

Description of the problem including expected versus actual behavior:
For geo_shape fields ignore_malformed:true does not work if the coordinates field contains on object or an array with only one element. Instead of not indexing the field a mapper_parsing_exception is returned and the document is not stored.

Steps to reproduce:

  1. create index with a geo_shape field
{
    "mappings": {
        "docs": {
            "properties": {
                "location": {
                    "type": "geo_shape",
                    "ignore_malformed":true
                }
            }
        }
    }
}
  1. insert one of the follwing documents containing invalid GeoJSON
{
  "location": {
    "type": "point",
    "coordinates": {}
  }
}
{
  "location": {
    "type": "point",
    "coordinates": [0]
  }
}

Metadata

Metadata

Assignees

Labels

:Analytics/GeoIndexing, search aggregations of geo points and shapes:Search Foundations/MappingIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions