WARNING: Version 2.3 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
ignore_malformed
editignore_malformed
editSometimes you don’t have much control over the data that you receive. One
user may send a login
field that is a date
, and another sends a
login
field that is an email address.
Trying to index the wrong datatype into a field throws an exception by
default, and rejects the whole document. The ignore_malformed
parameter, if
set to true
, allows the exception to be ignored. The malformed field is not
indexed, but other fields in the document are processed normally.
For example:
PUT my_index { "mappings": { "my_type": { "properties": { "number_one": { "type": "integer" }, "number_two": { "type": "integer", "ignore_malformed": true } } } } } PUT my_index/my_type/1 { "text": "Some text value", "number_one": "foo" } PUT my_index/my_type/2 { "text": "Some text value", "number_two": "foo" }
This document will be rejected because |
|
This document will have the |
The ignore_malformed
setting is allowed to have different settings for
fields of the same name in the same index. Its value can be updated on
existing fields using the PUT mapping API.
Index-level default
editThe index.mapping.ignore_malformed
setting can be set on the index level to
allow to ignore malformed content globally across all mapping types.