How to do it...

We can extend the previous mapping by adding document-related settings, as follows:

PUT test/_mapping
{
"dynamic_date_formats":["yyyy-MM-dd", "dd-MM-yyyy"],\
"date_detection":true,
"numeric_detection":true,
"dynamic_templates":[
{"template1":{
"match":"*",
"match_mapping_type":"long",
"mapping":{"type":" {dynamic_type}", "store":true}
}} ],
"properties" : {...}
}