Hi,
I am facing following 2 problems, please help if some could
- I have created index with date field of type date with custom format , when i am trying to insert the value its giving error ( but i have provided the format )
Index creation :
PUT date_index_both
{
"mappings": {
"my_type": {
"properties": {
"date": {
"type": "date",
"format":
"MM-dd-yyyy||M-dd-yyyy||dd-M-yyyy||dd-MM-yyyy||d-MM-yyyy||d-M-yyyy||dd-MMM-yyyy||d-MMM-yyyy||MMM-dd-yyyy||MMM-d-yyyy||yyyy-MM-dd||yyyy-M-d||yyyy-MMM-d||yyyy-dd-MMM||MM/dd/yyyy||M/d/yyyy||dd/M/yyyy||dd/MM/yyyy||d/MM/yyyy||d/M/yyyy||dd/MMM/yyyy||d/MMM/yyyy||MMM/dd/yyyy||MMM/d/yyyy||yyyy/MM/dd||yyyy/M/d||yyyy/MMM/d||yyyy/dd/MM"
}
}
}
}
}
Inserting value:
PUT date_index_both/my_type/1
{ "date": "20/01/2017" }
Output :
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse [date]"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse [date]",
"caused_by": {
"type": "illegal_field_value_exception",
"reason": "Cannot parse "20/01/2017": Value 20 for monthOfYear must be in the range [1,12]"
}
},
"status": 400
}
Note:: I have provided the format (dd/MM/yyyy)
- Some date values I inserted are not searchable with all the format provided in mapping in Kibana search bar
Ex.:
Inserted value:
PUT date_index_both/my_type/1
{ "date": "22-jan-2017" }
Getting required output with << date: (01-22-2017) >> in kibana search but getting shard error with no result for any search with forward slash format (i.e.: date:22/01/2017 , date: (22/jan/2017)
Please provide helpful suggestion if anyone have idea!!
Thanks in advance