Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Short Description:

...

elastic-search uses river inteface for adding/updating indexes. A river is a pluggable service running within elasticsearch cluster pulling data (or being pushed with data) that is then indexed into the cluster.

For fetching data from MySQL database we use MySQL river. River can be setuped using request to Elasticsearch with next params (for example) 

curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
            "type" : "jdbc",
            "jdbc" : {
                "driver" : "com.mysql.jdbc.Driver",
                "url" : "jdbc:mysql://" + dbHost + ":3306/" + dbName,
                "user" : dbUser,
                "password" :dbPass,
                "sql" : sql,
                "strategy" : "simple"
            },
            "index" : {
                "index" : indexName,
                "type" : indexType
            }
}'

sql - sql statements for fetching data froom MySQL database;

...