painless 向es 写入数据 提示failed to parse field [attributes.xxx] of type [date] in document with id 'xxx'. Preview of field's value: '2028-02-21 00:00:00']

if (attrValue instanceof String && checkTimeFormat(attrValue.toString())) {
updateScript = String.format("def datetime = params.value; ctx._source.attributes.%s = datetime;",attrId) ;
}
private boolean checkTimeFormat(String validateDate) {
Date tmpDate = DateUtil.convert2Date(validateDate);
return Objects.nonNull(tmpDate);
}
posted @ 2024-05-27 11:50  伏笔lisa  阅读(149)  评论(0)    收藏  举报