I am using dynamic template
PUT _template/agg
{
  "index_patterns":["aggs*"],
  "settings": {
    "number_of_shards": 5,
    "number_of_replicas": 1
    
  },
  "mappings": {
    "pk*":{
      "_source": {
        "enabled": true
      },
      "dynamic_templates":[
        {
          "strings":{
            "match":"*",
            "match_mapping_type":"string",
            "mapping":{
              "type":"keyword"
            }
          }
        }
        
        ]
    }
  }
}
when i run the below query m getting the following exception
PUT aggs/pkp_order/1
{
  "name":"prasad"
}
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [aggs] as the final mapping would have more than 1 type: [pkp_order, pk*]"
Do we need to fix the index type at the creation of template level only?
As in higher versions,one index can have one type only,but i have all the indices which starts with aggs & their index type starts with pkp_******(different names after pkp for diffrent indexes )