2

I've ran this query and it worked well.

curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://localhost:3306/test",
        "user" : "myaccount",
        "password" : "myaccount",
        "sql" : "select * from orders"
    }
}'

Everything seems to be indexed. However, when I changed a data from the Orders Table, the changes did not reflect the document in ElasticSearch. Is it possible to automatically sync updated/changed data?

user962206
  • 15,637
  • 61
  • 177
  • 270

2 Answers2

3

You need to add another parameter for schedule to tell jdbc-river to pull data periodically.

Here is a reference to this.

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76
  • What worries me is polling wouldn't scale I was looking for a trigger or something better – KyelJmD Jun 21 '14 at 12:48
  • You are the best judge of polling's scalability in your case :) I am afraid that afaik elasticsearch does not have the ability to subscribe to events by itself. However, es clients such as tire for ruby help attach hooks to your orm, that pushes delta updates to es, when saving to a rdbms. – Srikanth Venugopalan Jun 21 '14 at 14:00
0

I'm using elastic search on Windows 7. I have a trouble with load river-jdbc to sync elasticsearch with mysql. I try loading all river-jdbc river but the result is :

Execution Error

[java.lang.NoClassDefFoundError:org/elasticsearch/rest/XcontentThrowableRestResponse], NoClassDefFoundError[org/elasticsearch/rest/XcontentThrowableRestResponse], ClassNotFoundExeption[org/elasticsearch/rest/XcontentThrowableRestResponse]

P/s: OS: Window 7, elasticsearch 1.2.1, mysql-connector-java-5.1.25-bin.jar

dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
akira
  • 1