Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_malformed doesn't always work for invalid geoJSON #31428

Closed
Lumaraf opened this issue Jun 19, 2018 · 1 comment
Closed

ignore_malformed doesn't always work for invalid geoJSON #31428

Lumaraf opened this issue Jun 19, 2018 · 1 comment
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@Lumaraf
Copy link

Lumaraf commented Jun 19, 2018

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]
  }
}
@vladimirdolzhenko vladimirdolzhenko added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Jun 19, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@imotov imotov self-assigned this Jun 19, 2018
@imotov imotov added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes labels Jun 19, 2018
imotov added a commit to imotov/elasticsearch that referenced this issue Jun 19, 2018
Ensures that malformed geoshapes are more reliably ignored if
"ignore_malformed" is set to true instead of failing the entire
document.

Closes elastic#31428
imotov added a commit that referenced this issue Jun 26, 2018
Ensures that malformed geoshapes are more reliably ignored if
"ignore_malformed" is set to true instead of failing the entire
document.

Closes #31428
imotov added a commit that referenced this issue Jun 26, 2018
Ensures that malformed geoshapes are more reliably ignored if
"ignore_malformed" is set to true instead of failing the entire
document.

Closes #31428
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants