0

Now i am working with elasticsearch-river-jdbc.When i update Mysql database,i want my elasitcsearchdata will update(automatic).When i created a river,this is my code:

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"
    }
}'
But when i update mysql,nothing in elasticsearch data changes. So what is my wrong??
voxter
  • 853
  • 2
  • 14
  • 30

1 Answers1

0

Simply add 'schedule' as documented here: 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 …"
 }]  
}

(This one will get updates every minute)

baraka
  • 807
  • 8
  • 16