I want my indices to recognise a few different date formats. Some of these formats look like this:
29.06.06 (so a date format of "dd.MM.yy"?)
29-06-06
29/Jun/2006.
From what I've read, I think I need to create a dynamic mapping like this:
put $indexname/_mapping/_default_
{
"date_detection": true,
"dynamic_templates": [
{
"dates": {
"match": ".*date.*|.*DATE.*|.*Date.*",
"match_pattern": "regex",
"mapping": {
"type": "date",
"format": "dd.MM.yy||dd-MM-yy||dd/MM/yyyy||strict_date_optional_time||dateOptionalTime"
}
}
}]
}
How can I do this on index creation?