问题
Is it possible to do bulk atomic updates in ElasticSearch?
I am aware that regular bulk updates are not atomic as noted here: https://www.elastic.co/guide/en/elasticsearch/guide/current/bulk.html#bulk
Is there any other way to atomically update multiple documents? i.e. Either all the updates happen or none of them do.
回答1:
Elasticsearch doesn't currently have a way to do what you're asking for. There are several responses to this question on the Elasticsearch site.
https://discuss.elastic.co/t/is-es-support-transaction-such-as-rollback/12579
https://discuss.elastic.co/t/rollback-es-6/85958
https://github.com/elastic/elasticsearch/issues/15316
Currently you would need to architect a solution yourself. There is an interesting blog about a potential solution here: https://blog.codecentric.de/en/2014/10/transactions-elasticsearch/
来源:https://stackoverflow.com/questions/52539822/elasticsearch-atomic-bulk-update