hello everyone
I have a default template setting using pattern * and set some dynamic mapping
PUT /_template/template_default
{
"index_patterns" : ["*"],
"order" : 0,
"settings": {
"index": {
"number_of_shards": "3"
}
},
"mappings" : {
"doc": {
"dynamic_templates": [
{
"strings_as_keywords": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
"norms": false
}
}
}
]
}
}
}
now i meet some special requirement that the _type should be values
. So I create a new template
PUT /_template/zabbix_dbl
{
"index_patterns" : ["zabbix_dbl-*"],
"order" : 0,
"settings": {
"index": {
"number_of_shards": "3"
}
},
"mappings" : {
"values" : {
"properties" : {
"itemid" : {
"type" : "long"
},
"clock" : {
"format" : "epoch_second",
"type" : "date"
},
"value" : {
"type" : "double"
}
}
}
},
"aliases": {
"zabbix_dbl_get": {}
}
}
when i create new index by PUT zabbix_dbl-000001
there will be an error
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [zabbix_dbl-000001] as the final mapping would have more than 1 type: [values, doc]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [zabbix_dbl-000001] as the final mapping would have more than 1 type: [values, doc]"
},
"status": 400
}
it seems both above templates are applied to the index
how could i define a template properly having a different mapping _type name, please?