springboot Elasticsearch 实体创建索引设置Date 类型字段失败
springboot Elasticsearch 实体创建索引设置Date 类型字段失败,需添加以下注解
@Field(type = FieldType.Date,
format = DateFormat.custom,
pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'",timezone="GMT+8")
之后查询可对其进行格式化