I've the following index definition for the date:
"handshaketime" : {"type":"date","format":"YYYY-MM-ddTHH:mm:ss.SSSZ"}
And the actual date is of this form:
"handshaketime":"2015-04-07T10:43:03.000-07:00"
I've specified that date coming from DB has the above mentioned format but elasticsearch still gives me the following error.
Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to
parse date field [2015-04-07T10:43:03.000-07:00], tried both date format
[YYYY-MM-dd HH:mm:ss], and timestamp number with locale []
I'm using elasticsearch 1.4.4 with jdbc_river 1.4.0.10.
Please tell me whats going on.
In trying to fix this error, I came across the same result, despite what @Vineeth provided. I pointed to him that for some reason ES is not showing the format that we supplied but instead gives the same error over and over again.
Finally, I came across a post describing the removal of all indexes in ES and re-submitting our index/mapping document afresh (aka clean-slating). Voila! it worked, in fact it worked if i just gave the following:
"handshaketime":{"type":"date", "format": "dateOptionalTime"}
Not even custom format that me and @Vineeth were discussing about!!
So if you are struggling with this problem, make sure there are NO indexes in the ES that may be preventing you to index your new document.
Thanks for trying to sort this issue @Vineeth.
You have to give it as follows - There should be single quotes for T as its not a time identifier.
{"type":"date","format":"YYYY-MM-dd'T'HH:mm:ss.SSSZ"}
If you are using shell script , you need to give it as follows -
{"type":"date","format":"YYYY-MM-dd'"'T'"'HH:mm:ss.SSSZ"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With