Dear group,
I'm experiencing an issue with Bulk API.
Here is an example set of commands to be processed using the bulk API :
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "title" : "Great Title of doc 1" }
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "title" : "Great Title of doc 2" }
{ "update" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "doc" : { "date" : "2014-04-30T23:59:57" }}
{ "update" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "doc" : { "date" : "2014-04-31T00:00:01" }}
{ "delete" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
Here, the 4th command (update of document with _id == 2) is expected to
fail, and it does (The date is invalid, April's days are in the [1-30]
range).
Here is the response I get from the API :
{
"took" : 4,
"errors" : true,
"items" : [ {
"index" : {
"_index" : "test",
"_type" : "type1",
"_id" : "1",
"_version" : 8,
"status" : 201
}
}, {
"index" : {
"_index" : "test",
"_type" : "type1",
"_id" : "2",
"_version" : 5,
"status" : 201
}
}, {
"update" : {
"_index" : "test",
"_type" : "type1",
"_id" : "1",
"_version" : 9,
"status" : 200
}
}, {
"index" : {
"_index" : "test",
"_type" : "type1",
"_id" : "2",
"status" : 400,
"error" : "MapperParsingException[failed to parse [date]]; nested:
MapperParsingException[failed to parse date field [2014-04-31T00:00:01],
tried both date format [dateOptionalTime], and timestamp number with locale
[]]; nested: IllegalFieldValueException[Cannot parse
"2014-04-31T00:00:01": Value 31 for dayOfMonth must be in the range
[1,30]]; "
}
}, {
"delete" : {
"_index" : "test",
"_type" : "type1",
"_id" : "1",
"_version" : 10,
"status" : 200,
"found" : true
}
}, {
"delete" : {
"_index" : "test",
"_type" : "type1",
"_id" : "2",
"_version" : 6,
"status" : 200,
"found" : true
}
} ]
}
As we can see, the 4th item in the response is :
{
"index" : {
"_index" : "test",
"_type" : "type1",
"_id" : "2",
"status" : 400,
"error" : "MapperParsingException[failed to parse [date]]; nested:
MapperParsingException[failed to parse date field [2014-04-31T00:00:01],
tried both date format [dateOptionalTime], and timestamp number with locale
[]]; nested: IllegalFieldValueException[Cannot parse
"2014-04-31T00:00:01": Value 31 for dayOfMonth must be in the range
[1,30]]; "
}
}
I don't understand why the key for the item is "index" while the action was
an update.
I was expecting the response for item #4 to be:
{
"update" : {
"_index" : "test",
"_type" : "type1",
"_id" : "2",
"status" : 400,
"error" : "MapperParsingException[failed to parse [date]]; nested:
MapperParsingException[failed to parse date field [2014-04-31T00:00:01],
tried both date format [dateOptionalTime], and timestamp number with locale
[]]; nested: IllegalFieldValueException[Cannot parse
"2014-04-31T00:00:01": Value 31 for dayOfMonth must be in the range
[1,30]]; "
}
}
I looked into the source code, and I think the mismatch between the
operation type in the result and in the command comes from the following line
of code
https://github.com/elasticsearch/elasticsearch/blob/1.1/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java#L317,
but I can be wrong, I didn't edit it to verify.
I could dig deeper, simply open an issue, or provide more details,
depending on what do you guys actually prefer.
I'm using elasticsearch v1.1.1.
Thanks for your support,
--
Tanguy
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4462c395-f403-4005-9c2c-336050ca7022%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.