Skip to content

Commit

Permalink
Clarify mapping types that support ignore_malformed (#48206)
Browse files Browse the repository at this point in the history
The `ignore_malformed` setting only works on selected mapping types, otherwise
we throw an mapper_parsing_exception. We should add a list of all the mapping
types that support it, since the number of types not supporting it seems larger.

Closes #47166
  • Loading branch information
Christoph Büscher committed Oct 18, 2019
1 parent 5571d8c commit c1ce4ae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/reference/mapping/params/ignore-malformed.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ user may send a `login` field that is a <<date,`date`>>, and another sends a

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
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:
Expand Down Expand Up @@ -46,15 +46,24 @@ PUT my_index/_doc/2
<1> This document will have the `text` field indexed, but not the `number_one` field.
<2> This document will be rejected because `number_two` does not allow malformed values.

The `ignore_malformed` setting is currently supported by the following <<mapping-types,mapping types>>:

<<number>>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`
<<date>>:: `date`
<<date_nanos>>:: `date_nanos`
<<geo-point>>:: `geo_point` for lat/lon points
<<geo-shape>>:: `geo_shape` for complex shapes like polygons
<<ip>>:: `ip` for IPv4 and IPv6 addresses

TIP: The `ignore_malformed` setting value can be updated on
existing fields using the <<indices-put-mapping,PUT mapping API>>.


[[ignore-malformed-setting]]
==== Index-level default

The `index.mapping.ignore_malformed` setting can be set on the index level to
allow to ignore malformed content globally across all mapping types.
ignore malformed content globally across all allowed mapping types.
Mapping types that don't support the setting will ignore it if set on the index level.

[source,js]
--------------------------------------------------
Expand Down

0 comments on commit c1ce4ae

Please sign in to comment.