1

我按照本教程索引文档弹性搜索

https://github.com/jprante/elasticsearch-river-jdbc

当我进行索引 api 调用(PUT)时

curl -XPUT http://somedomain.com:9200/_river/myriver/_meta -d '
{ 
    "type" : "jdbc", 
    "jdbc" : { 
      "strategy" : "oneshot", 
        "driver" : "com.mysql.jdbc.Driver", 
        "url" : "jdbc:mysql://xx.xx.xxx.xxx:3306/portal", 
        "user" : "username", 
        "password" : "password", 
        "sql" : "select item_id as _id, item_id as itemId, item_name as name from item limit 10"         
    }, 
  "index" : { 
            "index" : "myindex", 
            "type" : "mytype" 
        } 
}'

响应显示

{ 
    "_index": "_river", 
    "_type": "myriver", 
    "_id": "_meta", 
    "_version": 1, 
    "created": true 
} 

当我得到它时,它只显示我在 jdbc 属性中发送的 1 个文档。

curl -XGET _river/myriver/_meta 
{ 
   "_index": "_river", 
   "_type": "myriver", 
   "_id": "_meta", 
   "_version": 1, 
   "found": true, 
   "_source": { 
      "type": "jdbc", 
      "jdbc": { 
         "strategy": "oneshot", 
         "driver": "com.mysql.jdbc.Driver", 
         "url": "jdbc:mysql://xx.xx.xxx.xxx:3306/portal", 
         "user": "username", 
         "password": "password", 
         "sql": "select item_id as _id, item_id as itemId, item_name as name from item limit 10" 
      }, 
      "index": { 
         "index": "myindex", 
         "type": "mytype" 
      } 
   } 
}'

在我的错误日志中

[2014-05-27 00:17:25,402][WARN ][river                    ] [Typhoid Mary] failed to get _meta from [jdbc]/[myriver] 
java.lang.NoSuchMethodError: org.xbib.elasticsearch.support.client.node.NodeClient.maxRequestWait(Lorg/elasticsearch/common/unit/TimeValue;)Lorg/xbib/elasticsearch/support/client/node/NodeClient; 
        at org.xbib.elasticsearch.plugin.feeder.AbstractFeeder.setClient(AbstractFeeder.java:205) 
        at org.xbib.elasticsearch.plugin.river.jdbc.JDBCRiver.start(JDBCRiver.java:74) 
        at org.elasticsearch.river.RiversService.createRiver(RiversService.java:148) 
        at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) 
        at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) 
        at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:93) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
        at java.lang.Thread.run(Thread.java:724) 
4

0 回答 0