Hi,
I have a simple index. When I add document, this document has a version of 1 as shown below.
If I then call _delete_for_update .... I always get version conflict and I don't know why. If I re-run the delete script then it is deleted as expected ...
There was no other insert nor update .... I call php script for insert and delete manually ....
Here is my example :
{
"_index" : "i8grpusr1",
"_type" : "grpusr",
"_id" : "70437463654587_447",
"_version" : 1,
"_score" : 1.0,
"_source" : {
"fk_groups" : "447",
"fullname" : "",
"gid_users" : "70437463654587"
}
},
{
"_index" : "i8grpusr1",
"_type" : "grpusr",
"_id" : "70437463654587_361",
"_version" : 1,
"_score" : 1.0,
"_source" : {
"fk_groups" : "361",
"fullname" : "",
"gid_users" : "70437463654587"
}
},
{
"_index" : "i8grpusr1",
"_type" : "grpusr",
"_id" : "70437463654587_449",
"_version" : 1,
"_score" : 1.0,
"_source" : {
"fk_groups" : "449",
"fullname" : "",
"gid_users" : "70437463654587"
}
}
After I all _delete_for_update I get this :
{
"took": 3,
"timed_out": false,
"total": 3,
"deleted": 1,
"batches": 1,
"version_conflicts": 2,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": -1.0,
"throttled_until_millis": 0,
"failures": [{
"index": "i8grpusr1",
"type": "grpusr",
"id": "70437463654587_447",
"cause": {
"type": "version_conflict_engine_exception",
"reason": "[grpusr][70437463654587_447]: version conflict, current version [2] is different than the one provided [1]",
"index_uuid": "kZXuIQAiSEy7HbdDs6KHXg",
"shard": "0",
"index": "i8grpusr1"
},
"status": 409
}, {
"index": "i8grpusr1",
"type": "grpusr",
"id": "70437463654587_449",
"cause": {
"type": "version_conflict_engine_exception",
"reason": "[grpusr][70437463654587_449]: version conflict, current version [2] is different than the one provided [1]",
"index_uuid": "kZXuIQAiSEy7HbdDs6KHXg",
"shard": "0",
"index": "i8grpusr1"
},
"status": 409
}]
}
And I call _delete_by_query like this :
{
"query": {
"term": {
"fk_groups": ' . $id . '
}
}
}