Mapper_parsing_exception on Date

hello everyone, I have an error when I insert my data, because of my bad mapping.
the format is 31/12/2018 for exemple

Here is the error

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "No handler for type [DATE] declared on field [DATE_JOUR]"
}
],
"type": "mapper_parsing_exception",
"reason": "No handler for type [DATE] declared on field [DATE_JOUR]"
},
"status": 400
}

here is the mapping:
"DATE_JOUR": {
"type": "DATE",
"format": "dd-mm-yyyy"
}

does anyone have an idea of where the mistake comes from?

Change "type": "DATE" by "type": "date"

it's work thank you.
But when i put json data with this date "DATE_JOUR":"2018-02-28 00:00:00.0"
i have this error :
String value: failed to parse field [DATE_JOUR] of type [date] in document with id 'ibzq_WoBlHm1_K3edXic'

it's not possible post this format ? and elasticsearch keep only the days, months and year

Don't send 2018-02-28 00:00:00.0 if you just want to store 2018-02-28.

The date mapping just helps to read your initial format. It does not transform the JSON you are providing.

ok thank you for your help :grinning:

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