Rizwan Mirza
Rizwan Mirza

Reputation: 31

elasticserach jdbc river when index document is not created

I follow this tutorial to indexing document elasticsearch

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

when i make index api call (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" 
        } 
}'

The the response shows

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

when i get it shows only 1 document what i sent in jdbc properties.

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" 
      } 
   } 
}'

in my error log

[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) 

Upvotes: 1

Views: 179

Answers (0)

Related Questions