We have some issues trying to index documents with date fields set on the 29 of February.
Below an example :
{"type":"mapper_parsing_exception","reason":"failed to parse field [date_updated] of type [date] in document with id 'mydoc_17107'. Preview of field's value: '2008-02-29 00:00:00'","caused_by":{"type":"date_time_exception","reason":"Invalid date 'February 29' as '1970' is not a leap year"}}
Using YYYY will not work, as this refers to a week based year.
I tried this on 7.4.0 and it worked just fine,.
DELETE test
PUT test
{
"mappings": {
"properties": {
"date_created": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
}
}
}
}
PUT test/_doc/1
{
"date_created" : "2008-02-29 00:00:00"
}
The document got indexed successfully as it is not using a week based year, but the year-of-era.
Can you please provide a minimal exact reproduction under 7.4.1 including index creation and mapping, so we can figure out what is going on and what is different to my sample, that yours does not work?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.