Exception in Date Format while inserting document in Elasticsearch through Java code


(Pinki Mondal) #1

I am getting below error
MapperParsingException[failed to parse [paymentValueDate]]; nested: IllegalArgumentException[Invalid format: "May 23, 2016"];

And I have used following formats:
"dd-MM-yy HH:mm:ss.SSSSSSSSS a || dd-MM-yy|| yyyy-MM-dd ||epoch_millis|| strict_date_optional_time"

Kindly help asap...


(Alexander Reelsen) #2

which from the date formats you specified do you expect to match against May 23, 2016? None of those data formats includes a comma and also not the format for the month in letters so I assume that this is the culprit. You need to add another date format.


(Pinki Mondal) #3

Please correct me if I'm wrong. I couldn't find out any format matching this format in ISO formats.
Please suggest me one


(Alexander Reelsen) #4

you need to construct your own, see the link in the ES docs, that points to the joda docs and explains which format you need.

sth like MMM dd, YYYY (untested)


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.