我想使用 elasticsearch 索引和搜索 mysql 数据库,我遵循了本教程
https://github.com/jprante/elasticsearch-river-jdbc/wiki/Quickstart
起初我下载了 elasticsearch 并在其插件文件夹中安装了 river-jdbc。然后在 ES_HOME/plugins/river-jdbc/ 中添加 mysql-jdbc 然后启动 elasticsearch 并启动另一个终端窗口,并使用此 curl 命令创建一个名为 my_jdbc_river 的新 JDBC River
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://localhost:3306/bablool",
"user" : "root",
"password" : "babloo",
"sql" : "select * from details"
},
"index" : {
"index" : "jdbc",
"type" : "jdbc"
}
}'
我收到以下错误:-
然后当我运行这个命令时:curl -XGET 'localhost:9200/jdbc/jdbc/_search?pretty&q=*'
我收到以下错误:
"error": "IndexMissingException[[jdbc] missing]", "status" : 404
当我在浏览器中给出这个时:
http://localhost:9201/_search?q=*
我是这样的:
{
"took": 51,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1.0,
"hits": [
{
"_index": "_river",
"_type": "my_jdbc_river",
"_id": "_meta",
"_score": 1.0,
"_source": {
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/bablool",
"user": "root",
"password": "babloo",
"sql": "select * from details"
},
"index": {
"index": "jdbc",
"type": "jdbc"
}
}
}
]
}
}
mysql dB是否被索引?如何在我的数据库中搜索?