现在我正在使用elasticsearch-river-jdbc。当我更新Mysql数据库时,我希望我的elasitcsearchdata会更新(自动)。当我创建一条河时,这是我的代码:
curl -XPUT '127.0.0.1:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/myapp_development",
"user" : "root",
"password" : "",
"sql" : "select * from users",
"autocommit" : "true"
}
}'
答案 0 :(得分:0)
只需添加'计划'如此处所述: elasticsearch-river-jdbc#time-scheduled-execution-of-jdbc-river
{
"type" : "jdbc",
"schedule" : "0 0-59 0-23 ? * *",
"jdbc" : [ {
"url" : "jdbc:mysql://localhost:3306/ZZZZ",
"user" : "root",
"password" : "ZZZ",
"sql" : "Select …"
}]
}
(这个会每分钟更新一次)