I have an object with different values in Elasticsearch. When I want to update it, I use bulk api like below:
inventory_edition.append(
{
'_op_type': 'update',
'_index': value_index,
'_id': object['inventory.id'],
'_source': {'doc': object}
}
)
It update previous items whom I call them and also add new items but I dont know how to remove a previous item whom I'm not calling it! How can I remove a previous item in editing object using bulk api?
"hits" : [
{
"_index" : "index-name",
"_type" : "_doc",
"_id" : "list144bbfba447b9552ece89391d075",
"_score" : 1.2039728,
"_source" : {
"inventory.name" : "list1-edit",
"inventory.type" : "ip",
"inventory.description" : "description",
"inventory.id" : "list144bbfba447b9552ece89391d075"
}
}
]
I solved this way.. I used delete and create in bulk api instead of update.