@@ -46,11 +46,22 @@ name as an existing template, it will replace the old version.
46
46
[[match-mapping-type]]
47
47
==== `match_mapping_type`
48
48
49
- The `match_mapping_type` matches on the datatype detected by
50
- <<dynamic-field-mapping,dynamic field mapping>>, in other words, the datatype
51
- that Elasticsearch thinks the field should have. Only the following datatypes
52
- can be automatically detected: `boolean`, `date`, `double`, `long`, `object`,
53
- `string`. It also accepts `*` to match all datatypes.
49
+ The `match_mapping_type` is the datatype detected by the json parser. Since
50
+ JSON doesn't allow to distinguish a `long` from an `integer` or a `double` from
51
+ a `float`, it will always choose the wider datatype, ie. `long` for integers
52
+ and `double` for floating-point numbers.
53
+
54
+ The following datatypes may be automatically detected:
55
+
56
+ - `boolean` when `true` or `false` are encountered.
57
+ - `date` when <<date-detection,date detection>> is enabled and a string is
58
+ found that matches any of the configured date formats.
59
+ - `double` for numbers with a decimal part.
60
+ - `long` for numbers without a decimal part.
61
+ - `object` for objects, also called hashes.
62
+ - `string` for character strings.
63
+
64
+ `*` may also be used in order to match all datatypes.
54
65
55
66
For example, if we wanted to map all integer fields as `integer` instead of
56
67
`long`, and all `string` fields as both `text` and `keyword`, we
0 commit comments