I have two questions about dynamic mappings.
I have set up a component template which looks like this:
PUT _component_template/syslog-mappings-dynamic
{
"version": 1,
"template": {
"mappings": {
"_source": {
"excludes": [],
"includes": [],
"enabled": true
},
"_routing": {
"required": false
},
"dynamic": true,
"numeric_detection": true,
"date_detection": false,
"dynamic_templates": [
{
"booleans": {
"mapping": {
"type": "boolean"
},
"match_mapping_type": "boolean"
}
},
{
"numbers_decimal": {
"mapping": {
"type": "double"
},
"path_unmatch": "*.postal_code",
"match_mapping_type": "double"
}
},
{
"numbers_no_decimal": {
"mapping": {
"type": "long"
},
"path_unmatch": "*.postal_code",
"match_mapping_type": "long"
}
},
{
"strings_as_keywords": {
"mapping": {
"ignore_above": 1024,
"type": "keyword"
},
"match_mapping_type": "string"
}
}
]
}
}
}
I now have the problem that if a new index is created and an ingest creates for example the dynamic field geo.postal_code
it's often mapped as type long
. Why is this happening even it's stated in path_unmatch
that it shouldn't?
And second question. How can you add multiple field-definitions in path_match
or path_unmatch
. For example if I want to unmatch *.postal_code
and *.some_other_field
- can this be done with path_unmatch: "*.postal_code, *.some_other_field"
?