{
"settings": {
"analysis": {
"filter": {
"substring": {
"type": "nGram",
"min_gram": "2",
"max_gram": "50"
}
},
"analyzer": {
"str_index_analyzer": {
"filter": [
"lowercase",
"substring"
],
"tokenizer": "standard"
},
"str_search_analyzer": {
"filter": [
"lowercase"
],
"tokenizer": "standard"
}
},
"normalizer": {
"lowercase_normalizer": {
"type": "custom",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
"test": {
"dynamic_date_formats": [
"strict_date_optional_time"
],
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
},
"longs": {
"match_mapping_type": "long",
"mapping": {
"type": "keyword"
}
},
"doubles": {
"match_mapping_type": "double",
"mapping": {
"type": "keyword"
}
}
}
],
"properties": {
"name": {
"type": "text",
"analyzer": "str_index_analyzer",
"search_analyzer": "str_search_analyzer",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"city": {
"type": "keyword",
"fields": {
"normalize": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
}
},
"state": {
"type": "keyword",
"fields": {
"normalize": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
}
}
}
}
}
}
}
Error Message is:
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "A dynamic template must be defined with a name"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [test]: A dynamic template must be defined with a name",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "A dynamic template must be defined with a name"
}
},
"status": 400
}