[英]How to Synchronize the DB from Index Using Elasticsearch
I have an use case where an Elasticsearch index and a MySQL Database should be remain synchronized and meet the following conditions. 我有一个用例,其中Elasticsearch索引和MySQL数据库应保持同步并满足以下条件。
1) Whenever I insert/update/delete in Elasticsearch index it should be synchronized with the Database(MySQL). 1)每当我在Elasticsearch索引中插入/更新/删除时,都应与数据库(MySQL)同步。
2) This synchronization should be done instantly. 2)此同步应立即完成。
3) For the Elasticsearch Index I am doing insert/update/delete at any time with any number of requests. 3)对于Elasticsearch Index,我可以随时对任意数量的请求进行插入/更新/删除。
How can I do this using Elasticsearch? 如何使用Elasticsearch做到这一点?
Thanks!! 谢谢!!
Check this out - Listener for ES 签出-ES的侦听器
So this is essentially a listener which gets invoked when the index gets updated / deleted . 因此,从本质上讲,这是一个在更新/删除索引时调用的侦听器。 So override the method postCreate ,postIndex and postDelete and accordingly update the MySQl DB
因此,覆盖方法postCreate,postIndex和postDelete并相应地更新MySQl DB
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.