es版本: 7.10.1基班纳版本: 7.10.0
首先,让我展示一下我的索引映射
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1,
"index.mapping.total_fields.limit": 10000,
"refresh_interval": "120s"
},
"mappings": {
"date_detection": false,
"dynamic_templates": [{
"integers": {
"match_mapping_type": "long",
"mapping": {
"type": "keyword"
}
}
},
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
],
"properties": {
"user": {
"type": "keyword"
},
"user_dept_name": {
"type": "keyword"
},
"user_dept_id": {
"type": "keyword"
},
"user_leave_dept_time": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"user_dept_time": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"user_dimission_time": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"user_dimiss_apply_time": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"user_status": {
"type": "keyword"
},
"nested_object": {
"type": "nested"
},
"operation_type": {
"type": "keyword"
},
"message": {
"type": "text"
},
"throw_exception": {
"type": "text"
},
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"time": {
"type": "date",
"format": "HH:mm:ss.SSSZ"
}
}
}在基班纳的中,当我尝试插入数据时,有时可以成功插入数据,有时会提示异常。
我不知道问题出在哪里,我希望朋友们能帮我
电子邮件: lcxkaka@foxmail.com
发布于 2021-01-05 03:34:29
在date格式的time字段中,您使用的是"format": "HH:mm:ss.SSSZ" (注意到SSS),但是在索引数据("10:12:08.61+0800")时,只有2位的S。
因此,您需要将数据重新格式化为"10:12:08.061+0800",或者更改索引映射,如下所示-
你需要把你的地图改成-
{
"mappings": {
"properties": {
"time": {
"type": "date",
"format": "HH:mm:ss.SSZ" // note this
}
}
}
}https://stackoverflow.com/questions/65572767
复制相似问题