我确定连接是无问题,表里数据也有,而且我也insert了很多条数据
同步:curl -XPOST 'localhost:9200/_river/my_geo_river/_meta' -d '
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/profile",
"user" : "root",
"password" : "root",
"locale" : "en_US",
"sql" : [
{
"statement" : "select \"name\" as _index, \"login_name\" as _type, id as _id from user"
}
],
"index" :"myjdbc",
"type" : "mytype"
}
}
'
但是得到结果:curl -XGET 'localhost:9200/myjdbc/_search?pretty'
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}