title: ElasticSearch date conversion to Java LocalDateTime failing
body: <p>I have a micro service that reads data from ElasticSearch index and process it. This index has a date field and I am not able to load date field data in to document entity. Here is snapshot of what I am trying achieve.</p>
  
  <p>Index</p>
  
  <pre><code>"date_created": {
    "type": "date"
  }
  </code></pre>
  
  <p>It is storing date as </p>
  
  <pre><code>"date_created": "2015-07-02T14:56:51.000Z"
  </code></pre>
  
  <p>My entity class</p>
  
  <pre><code>@Data
  @NoArgsConstructor
  @AllArgsConstructor
  @Document(indexName = "account", type = "doc")
  public class Account implements Serializable {
  
  ...
  
      @JsonProperty("date_created")
      @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      private LocalDateTime dateCreated;
  
  ...
  
  }
  </code></pre>
  
  <p>Error I get when I fetch records from ElasticSearch repository at run time is as below</p>
  
  <pre><code>nested exception is org.springframework.data.elasticsearch.ElasticsearchException: failed to map source ...
  java.time.format.DateTimeParseException: Text '2002-08-05T04:00:00.000Z' could not be parsed, unparsed text found at index 23
  </code></pre>
  
  <p>Is there a way I can get around this issue? I will be trying to change index definition &amp; JsonFormat as below, but I am not sure if that will work. I am asking in advance because I will take time to implement change in index. </p>
  
  <p>Index change I will try later.</p>
  
  <pre><code>"date_created": {
    "type": "date",
    "format": "yyyy-MM-dd'T'HH:mm:ss.SSS"
  }
  </code></pre>
  
  <p>JsonFormat change</p>
  
  <pre><code>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
  </code></pre>
  
  <p>Your help is much appreciated.</p>