我正在尝试将ElasticSearch与MySQL结合使用。 JDBC River似乎正是我想要的,但我无法使用以下任何位置插入数据{/ 1}}
jdbc/jdbc
我希望可以在curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://localhost:3306/the_db",
"user" : "root",
"password" : "hunter2",
"sql" : "select * from hamburgers",
"index" : "the_db",
"type" : "hamburgers"
}
}'
(我可以从the docs清除)访问数据,但这些数据都在localhost:9200/the_db/hamburgers
答案 0 :(得分:7)
我相信你错误地定义了河流。正确的方法是:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://localhost:3306/the_db",
"user" : "root",
"password" : "hunter2",
"sql" : "select * from hamburgers",
},
"index" : {
"index" : "the_db",
"type" : "hamburgers"
}
}'