Skip to content

[Bug] 'ignore_malformed' applied to a malformed (boolean) numeric field does not work  #11498

@angeleg

Description

@angeleg

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions