Uploaded image for project: 'Spring Data Elasticsearch'
  1. Spring Data Elasticsearch
  2. DATAES-953

DateTimeException occurred "yyyy-MM-dd HH: mm: ss" string is converted to Date

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.0.4 (Neumann SR4), 4.1 RC2 (2020.0.0)
    • Component/s: Core
    • Labels:
      None
    • Environment:
       Spring Boot 2.3.4.RELEASE

      Description

      Here is entity field

       Without any other configuration, I can write it to Elasticsearch, but I can't read. The following exception occurred

      The whole stack is in there: exception stack.txt

       

      By the way,  I think the problem is in 'ElasticsearchDateConverter.parse(String)'

      Instant can‘t use the result of  'dateFormatter.parse(input)' as a parameter to execute the from method. It should just like 'JavaDateFormatter.format' do.

      Convert TemporalAccessor to ZonedDateTime by 'DateFormatters.from' , and then Instant.from(ZonedDateTime).

      'ElasticsearchDateConverter.parse(String)' is modified as follows

      The above is my opinion, I hope the problem can be solved. Thank you!

        Attachments

          Activity

            People

            Assignee:
            sothawo sothawo
            Reporter:
            zhouxin2333 zhouxin2333
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: