I'm using spring-data-elasticsearch 4.0.1 and elastic cluster 7.6, when I define an attribute with a custom pattern with "yyyy-MM-dd" and try to retrieve a date with value "2014-06-11" it throws an error.
@Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd")
private Date startDate;
Error:
java.time.DateTimeException: Unable to obtain Instant from TemporalAccessor: {},ISO resolved to 2014-06-11 of type java.time.format.Parsed
I tried with this also but get an error again:
@Field(type = FieldType.Date, format = DateFormat.date_optional_time)
private Date startDate;
I read in the documentation that I should use the pattern "uuuu-MM-dd" for elastic 7 version, but this doesn't work either.
LocalDateinstead ofDate.