# Geo\_shape and unsupported validation\_method : IGNORE\_MALFORMED

**URL:** <https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887>\
**Category:** Elasticsearch\
**Created:** [March 24, 2017, 12:57pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887 "2017-03-24T12:57:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daviddd](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@daviddd](https://discuss.elastic.co/u/daviddd)\
**Post date:** [March 24, 2017, 12:57pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/1 "2017-03-24T12:57:34Z")

</div>

Dear All,

I'm using ES 5.2

I would need to specify a field where the BBOX could be wrong, e.g. I could have -180.0000001, ideally wrong BBOX could not be indexed.

Reading [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html)  
I tried to add  
'bbox': {'type': 'geo\_shape', 'precision': '10km', 'tree': 'quadtree', 'validation\_method': 'IGNORE\_MALFORMED'},

But I got:  
CommandError:\*\*\*  
'mapper\_parsing\_exception', 'Mapping definition for [bbox] has unsupported parameters: [validation\_method : IGNORE\_MALFORMED]')

Ideas?

Thanks,

D

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 24, 2017, 1:33pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/2 "2017-03-24T13:33:56Z")

</div>

On a phone so I can't look at the code. Can you try with the same option but lowercased?

---

<div class="post-metadata">

**Author:** ![daviddd](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@daviddd](https://discuss.elastic.co/u/daviddd)\
**Post date:** [March 24, 2017, 1:59pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/3 "2017-03-24T13:59:03Z")

</div>

Thanks David for replying so quicky!

I also tried:

```
PUT test1
{
    "settings" : {
        "number_of_shards" : 1
    },
    "mappings" : {
        "type1" : {
            "properties" : {
                "field1" : { "type" : "text" },
                "bbox": {
                  "type": "geo_shape",
                  "precision": "10km",
                  "tree": "quadtree",
                  "validation_method": "ignore_malformed"
                  }
            }
        }
    }
}

```

an I got:

```
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Mapping definition for [bbox] has unsupported parameters: [validation_method : ignore_malformed]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping [type1]: Mapping definition for [bbox] has unsupported parameters: [validation_method : ignore_malformed]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Mapping definition for [bbox] has unsupported parameters: [validation_method : ignore_malformed]"
    }
  },
  "status": 400
}

```

The same using:  
"validation\_method": "COERCE" or "validation\_method": "coerce":  
"reason": "Mapping definition for [bbox1] has unsupported parameters: [validation\_method : COERCE]"

Or the deprecated (5.0.0) ignore\_malformed

Removing  
`"validation_method": "ignore_malformed"`

Of course it works, but while indexing I have:

`'error': {'type': 'mapper_parsing_exception', 'caused_by': {'type': 'invalid_shape_exception', 'reason': 'Bad X value 180.083333 is not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)'}, 'reason': 'failed to parse [bbox]'}, '_type': 'layer'}}, {'index': {'status': 400, '_index': 'myindex', '_id': '10877', 'error': {'type': 'mapper_parsing_exception', 'caused_by': {'type': 'invalid_shape_exception', 'reason': 'Bad X value 180.083333 is not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)'}, 'reason': 'failed to parse [bbox]'}, '_type': 'layer'}}])`

Because some BBOX could be wrong and I simply don't want to index that field only.

D

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 24, 2017, 3:52pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/4 "2017-03-24T15:52:50Z")

</div>

This option is only at query time. It's not part of the mapping.

For mapping read: [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/geo-point.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/geo-point.html)

---

<div class="post-metadata">

**Author:** ![daviddd](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@daviddd](https://discuss.elastic.co/u/daviddd)\
**Post date:** [March 24, 2017, 6:31pm UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/5 "2017-03-24T18:31:53Z")

</div>

Thanks David.  
I still don't get how it's possibile to query malformed BBOX if I cannot insert them.  
Isn't it more useful to be able to skip only the malformed field instead of skipping the entire record?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 25, 2017, 4:44am UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/6 "2017-03-25T04:44:08Z")

</div>

May be open a feature request on GitHub about your needs?

Ignore malformed still exist in mapping: [https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html)

---

<div class="post-metadata">

**Author:** ![daviddd](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@daviddd](https://discuss.elastic.co/u/daviddd)\
**Post date:** [March 25, 2017, 5:37am UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/7 "2017-03-25T05:37:43Z")

</div>

I just created it: [https://github.com/elastic/elasticsearch/issues/23747](https://github.com/elastic/elasticsearch/issues/23747)  
Let's see what the team will decide.  
Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 22, 2017, 5:38am UTC](https://discuss.elastic.co/t/geo-shape-and-unsupported-validation-method-ignore-malformed/79887/8 "2017-04-22T05:38:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
