您可以添加
ignore_malformed: true到所有
date字段,也可以全局设置:
仅date
字段:
"dynamic_templates": [ { "string_fields": { "match": "*", "match_mapping_type": "string", "mapping": { "type": "string", "index": "analyzed", "analyzer": "whitespace", "fielddata": { "format": "disabled" }, "fields": { "raw": { "type": "string", "index": "not_analyzed", "ignore_above": 256 } } } } }, { "date_fields": { "match": "*", "match_mapping_type": "date", "mapping": { "type": "date", "ignore_malformed": true } } } ]全局设置 :
{ "settings": { "index.mapping.ignore_malformed": true }, "mappings": { "_default_": { "dynamic_templates": [ { "string_fields": { "match": "*", "match_mapping_type": "string", "mapping": { "type": "string", "index": "analyzed", "analyzer": "whitespace", "fielddata": { "format": "disabled" }, "fields": { "raw": { "type": "string", "index": "not_analyzed", "ignore_above": 256 } } } } } ] } }}


