海洋与鸥 2015-03-13 07:51 采纳率: 0%
浏览 5769

Elasticsearch使用elasticsearch-river-jdbc同步

我确定连接是无问题,表里数据也有,而且我也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" : [ ]
}
}

  • 写回答

3条回答 默认 最新

  • 追梦令 2015-06-12 03:10
    关注

    看一下 Elasticsearch 的控制台有没有报错

    评论

报告相同问题?

悬赏问题

  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示