-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>enhancementTeam:StorageEnginehelp wantedadoptmeadoptme
Description
Indexing a document with an object type on a field that has already been mapped as a string type causes MapperParsingException, even if index.mapping.ignore_malformed has been enabled.
Reproducible test case
On Elasticsearch 1.6.0:
$ curl -XPUT localhost:9200/broken -d'{"settings":{"index.mapping.ignore_malformed": true}}'
{"acknowledged":true}
$ curl -XPOST localhost:9200/broken/type -d '{"test":"a string"}'
{"_index":"broken","_type":"type","_id":"AU6wNDGa_qDGqxty2Dvw","_version":1,"created":true}
$ curl -XPOST localhost:9200/broken/type -d '{"test":{"nested":"a string"}}'
{"error":"MapperParsingException[failed to parse [test]]; nested: ElasticsearchIllegalArgumentException[unknown property [nested]]; ","status":400}
$ curl localhost:9200/broken/_mapping
{"broken":{"mappings":{"type":{"properties":{"test":{"type":"string"}}}}}}
Expected behaviour
Indexing a document with an object field where Elasticsearch expected a string field to be will not fail the whole document when index.mapping.ignore_malformed is enabled. Instead, it will ignore the invalid object field.
marcovdkuur, jordan-thoms, rgarcia, dr0i, sunkuet02 and 54 morenktl, pbarker, berk-can, jinesh90, lithg and 3 more
Metadata
Metadata
Assignees
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>enhancementTeam:StorageEnginehelp wantedadoptmeadoptme