From b89039e925bad14fe8f17feca22638cd0132277e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 17 Oct 2019 18:23:59 +0200 Subject: [PATCH 1/3] Clarify mapping types that support ignore_malformed 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 --- .../mapping/params/ignore-malformed.asciidoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/reference/mapping/params/ignore-malformed.asciidoc b/docs/reference/mapping/params/ignore-malformed.asciidoc index 656b679ffe9eb..97c46ee2c0049 100644 --- a/docs/reference/mapping/params/ignore-malformed.asciidoc +++ b/docs/reference/mapping/params/ignore-malformed.asciidoc @@ -7,7 +7,7 @@ user may send a `login` field that is a <>, 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: @@ -46,15 +46,23 @@ 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 <>: +* <>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float` +* <>:: `date` +* <>:: `date_nanos` +* <>:: `geo_point` for lat/lon points +* <>:: `geo_shape` for complex shapes like polygons +* <>:: `ip` for IPv4 and IPv6 addresses + TIP: The `ignore_malformed` setting value can be updated on existing fields using the <>. - [[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. +allow to ignore malformed content globally across all mapping types that allow it. +Mapping types that don't support the setting will ignore it if set on the index level. [source,console] -------------------------------------------------- From d76c344f716dc95cffd6a9c110be1be758c6c776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 18 Oct 2019 19:22:21 +0200 Subject: [PATCH 2/3] Fix formatting --- docs/reference/mapping/params/ignore-malformed.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference/mapping/params/ignore-malformed.asciidoc b/docs/reference/mapping/params/ignore-malformed.asciidoc index 97c46ee2c0049..7f355f83ea864 100644 --- a/docs/reference/mapping/params/ignore-malformed.asciidoc +++ b/docs/reference/mapping/params/ignore-malformed.asciidoc @@ -47,6 +47,7 @@ PUT my_index/_doc/2 <2> This document will be rejected because `number_two` does not allow malformed values. The `ignore_malformed` setting is currently supported by the following <>: + * <>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float` * <>:: `date` * <>:: `date_nanos` @@ -61,7 +62,7 @@ existing fields using the <>. ==== 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 that allow it. +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,console] From 6c3dd2dd9bd60e2ac6eb497545010b90109c1d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 18 Oct 2019 19:33:26 +0200 Subject: [PATCH 3/3] format fix --- .../mapping/params/ignore-malformed.asciidoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/mapping/params/ignore-malformed.asciidoc b/docs/reference/mapping/params/ignore-malformed.asciidoc index 7f355f83ea864..9ea5be72bdb28 100644 --- a/docs/reference/mapping/params/ignore-malformed.asciidoc +++ b/docs/reference/mapping/params/ignore-malformed.asciidoc @@ -48,12 +48,12 @@ PUT my_index/_doc/2 The `ignore_malformed` setting is currently supported by the following <>: -* <>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float` -* <>:: `date` -* <>:: `date_nanos` -* <>:: `geo_point` for lat/lon points -* <>:: `geo_shape` for complex shapes like polygons -* <>:: `ip` for IPv4 and IPv6 addresses +<>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float` +<>:: `date` +<>:: `date_nanos` +<>:: `geo_point` for lat/lon points +<>:: `geo_shape` for complex shapes like polygons +<>:: `ip` for IPv4 and IPv6 addresses TIP: The `ignore_malformed` setting value can be updated on existing fields using the <>.