问题:

  使用ES Java 高级客户端api新增数据时,实体类中包含时间字段,于是按照正常的传入数据新增,ES API接口报错,转化失败

  Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse field [createTime] of type [date] in document with id '4']

ES 中关于时间字段的处理

 

 

ES 中关于时间字段的处理

 

 实体类中和 ES mapping 映射信息都对时间进行了格式转化,但是还是不行

 

解决方法:

将实体类中的Date类型改成String,ES mapping映射的类型不变,还是date,格式yyyy-MM-dd HH:mm:ss

 

相关文章:

  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-07-04
猜你喜欢
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-09-25
  • 2021-08-11
相关资源
相似解决方案