Parsing problem with custom date format(YYYY-MM-dd HH:mm:ss.S) , failing when called with bulk API


(Biswajit Pathak) #1

I am trying to use bulk import after setting mapping for my index and type.

I am getting the following exception when running curl -XPOST http://localhost:9200/_bulk?pretty --data-binary @sample.json :

.......
},{ "index" : {
"_index" : "SOMEINDEX",
"_type" : "SOMETYPE",
"_id" : "2",
"status" : 400,
"error" : {
"type" : "mapper_parsing_exception",
"reason" : "failed to parse [customDate]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Invalid format: "2015-11-01 00:22:00.0" is malformed at " 00:22:00.0""
}
},{...

The mapping for only this (customDate) field is as follows:
.....
"customDate" : {
"type" : "date",
"format" : "YYYY-MM-dd HH:mm:ss.S"
},
.....

Data in sample.json is as follows:

...","customDate":"2015-11-01 00:09:00.0","...

I also tried deleting old index and creating a new one with applying mapping once again but it does not help.Please provide any suggestions or let me know in case I am missing anything?


(David Pilato) #2

Can you reproduce it from scratch?

May be your mapping has been applied?


(system) #3