-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Description
When I try to index a doc with a boolean field that's mapped as numeric, even with ìgnored_malformedset totrue`, an exception is raised.
Repro steps:
Create a new index:
curl -XPUT localhost:9200/myindex
which yields { "acknowledged" : true }
Create a mapping for a type in that index, with one integer field that has ignore_malformed set to true and coerce set to true
curl -XPUT localhost:9200/myindex/_mapping/mytype -d
'{
"mytype": {
"properties": {
"foo": {
"type": "integer",
"ignore_malformed": true,
"coerce": false
}
}
}
}'
which yields { "acknowledged" : true }
Index one document with a field whose value is false
curl -XPUT localhost:9200/myindex/mytype/one -d
'{
a: 3,
foo: false
}'
which yields an exception:
{
"error" : "MapperParsingException[failed to parse [foo]]; nested: JsonParseException[Current token (VALUE_FALSE) not numeric, can not use numeric value accessors at [Source: [B@3a98c595; line: 3, column: 13]]; ",
"status" : 400
}
According to ignored_malformed: true, even if false is not an integer, the doc should get indexed anyway.
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme