我正在尝试从数据库表中轮询数据 - 用户并在elasticsearch中填充,我在“index”部分指定索引名称,给出一个名称,索引被创建为“jdbc”。因此我只能将其查询为“host / jdbc / _search这是关于什么的?
这是创建用户索引的POST请求
http://localhost:9200/_river/users/_meta
{
"type" :
"jdbc",
"schedule" : "0 0-59 0-23 ? * *",
"jdbc" :
{
"driver":"com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://192.168.52.202/test_dev",
"user" : "test_user",
"password" : "test_pass",
"sql" : "select id as _id,first_name,city,email from USERS",
"index":"users",
"type":"user"
}
}
答案 0 :(得分:0)
问题是因为我在jdbc块中添加了索引和类型。我在几个例子中看到了这一点。在我更改了json结构之后,我移动了索引并输入索引块我得到了河流和用户索引
localhost:9200 / _river / my_jdbc_river / _meta - post
{ “类型”: “JDBC”,
“schedule”:“0 0-59 0-23?* *”,
“jdbc”: { “策略”: “简单”,
"driver":"com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://192.168.52.202/test_dev",
"user" : "test",
"password" : "test_pass",
"sql" : "select id as _id,first_name,city,email from USERS",
"poll":"2s"
}, “index”:{ “指数”:“用户”, “类型”:“用户”, “bulk_size”:500 } }