I have a date field that is in the following format:
01-JAN-20
When I map the field to dd-MMM-yy it won't accept the date above but it will accept the following:
01-Jan-20
Is there a way to get Elasticsearch to accept the former?
PUT tctestindex
{
"mappings": {
"properties": {
"date": {
"type": "date",
"format": "d-MMM-yy"
}
}
}
}
# works!
PUT tctestindex/_doc/1
{ "date": "01-Jan-20" }
#fails!
PUT tctestindex/_doc/2
{ "date": "01-JAN-20" }
spinscale
(Alexander Reelsen)
January 15, 2020, 10:45am
2
Hey,
I do not think is possible, after a quick scan of https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html (you may want to take a look yourself).
You could maybe convert this using a script processor and some text wranling.
--Alex
@spinscale - thanks for the response. I did see that link and saw this line:
M/L month-of-year number/text 7; 07; Jul; July; J
I just thought I might be missing something; specifically with what the "L" is for.
spinscale
(Alexander Reelsen)
January 20, 2020, 4:02pm
4
the L
is for the name only, but still requires the first (and only the first) letter to be uppercased from what I understand.
system
(system)
Closed
February 17, 2020, 4:07pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.