Create a mapping that makes all fields type as keyword type

Hi
Is there way to create an index that accept all dynamic fields as keyword type in case of type conflict ? For example:

doc 1,

   {
      "id":1,
       "name":"Li"
    } 

doc 2,

{
  "id":"uedjks",
   "name":"Wu"
} 

I can make an explicit mapping to specify id and name field type as keyword type :

"properties": {
   "id":{
      "type":"keyword"
   },
    "name":{
      "type":"keyword"
   }
}

When fields are dynamic and not determined, maybe hunderd or thousand fields, is there any way to make a mapping to accepted all fields as keyword type, such as use * accepted any field:

"properties": {
   "*":{
      "type":"keyword"
   }
}

Dynamic Template can solve it ! close.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.