{"action":"opened","issue":{"url":"https://api.github.com/repos/jprante/elasticsearch-jdbc/issues/702","labels_url":"https://api.github.com/repos/jprante/elasticsearch-jdbc/issues/702/labels{/name}","comments_url":"https://api.github.com/repos/jprante/elasticsearch-jdbc/issues/702/comments","events_url":"https://api.github.com/repos/jprante/elasticsearch-jdbc/issues/702/events","html_url":"https://github.com/jprante/elasticsearch-jdbc/issues/702","id":118671522,"number":702,"title":"How to bulk Upload a Child type in ElasticSearch ","user":{"login":"tarasingh","id":10125239,"avatar_url":"https://avatars.githubusercontent.com/u/10125239?v=3","gravatar_id":"","url":"https://api.github.com/users/tarasingh","html_url":"https://github.com/tarasingh","followers_url":"https://api.github.com/users/tarasingh/followers","following_url":"https://api.github.com/users/tarasingh/following{/other_user}","gists_url":"https://api.github.com/users/tarasingh/gists{/gist_id}","starred_url":"https://api.github.com/users/tarasingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarasingh/subscriptions","organizations_url":"https://api.github.com/users/tarasingh/orgs","repos_url":"https://api.github.com/users/tarasingh/repos","events_url":"https://api.github.com/users/tarasingh/events{/privacy}","received_events_url":"https://api.github.com/users/tarasingh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-24T18:14:38Z","updated_at":"2015-11-24T18:14:38Z","closed_at":null,"body":"Hi,\r\n\r\nI have relational data to upload to elastic search using parent child mapping strategy.\r\nI tried to look into elastic search documentation, it provides the curl script as\r\nPUT my_index/my_child/3?parent=1 \r\n{\r\n  \"text\": \"This is another child document\"\r\n}\r\n\r\nApproach to Upload the data\r\n1. Mapping code\r\n curl -XPOST http://localhost:9200/my_rptinfo -d '{\"mappings\": {\"rptdetails\": {},\"rptmetricdetails\": {\"_parent\": {\"type\": \"rptdetails\" }}}}'\r\n\r\n2. Code in .sh file\r\nbin=/usr/share/elasticsearch-jdbc-2.0.0.1/bin\r\nlib=/usr/share/elasticsearch-jdbc-2.0.0.1/lib\r\necho '{\r\n    \"type\" : \"jdbc\",\r\n    \"jdbc\": {\r\n        \"elasticsearch\" : {\r\n            \"cluster\" : \"XXX\",\r\n            \"host\" : \"XXX\",\r\n            \"port\" : \"9300\",\r\n            \"autodiscover\" : \"false\"\r\n        },\r\n        \"url\":\"jdbc:mysql://localhost/testdata\",\r\n        \"user\":\"xxx\",\r\n        \"password\":\"xxx\",\r\n        \"sql\":\"select * from rpt_bus_obj\",\r\n        \"index\" : \"my_rptinfo\",\r\n        \"type\" : \"rptmetricdetails\"\r\n    }\r\n}' | java \\\r\n       -cp \"${lib}/*\" \\\r\n       -Dlog4j.configurationFile=${bin}/log4j2.xml \\\r\n       org.xbib.tools.Runner \\\r\n       org.xbib.tools.JDBCImporter \r\n\r\n\r\n3. Error trace?\r\n\r\n [08:05:57,967][INFO ][importer.jdbc            ][pool-3-thread-1] strategy standard: settings = {elasticsearch.autodiscover=false, elasticsearch.cluster=Test-Cluster, elasticsearch.host=xxxxxx, elasticsearch.port=9300, index=my_rptinfo, password=xxx, sql=select * from rpt_bus_obj, type=rptmetricdetails, url=jdbc:mysql://localhost:3306/testdata, user=xxx}, context = org.xbib.elasticsearch.jdbc.strategy.standard.StandardContext@ebb65d3\r\n[08:05:57,970][INFO ][importer.jdbc.context.standard][pool-3-thread-1] found sink class org.xbib.elasticsearch.jdbc.strategy.standard.StandardSink@2e0335ad\r\n[08:05:57,976][INFO ][importer.jdbc.context.standard][pool-3-thread-1] found source class org.xbib.elasticsearch.jdbc.strategy.standard.StandardSource@2622578d\r\n[08:05:58,011][INFO ][org.xbib.elasticsearch.support.client.BaseTransportClient][pool-3-thread-1] creating transport client on Linux Java HotSpot(TM) 64-Bit Server VM Oracle Corporation 1.8.0_45-b14 25.45-b02 with effective settings {autodiscover=false, client.transport.ignore_cluster_name=false, client.transport.nodes_sampler_interval=5s, client.transport.ping_timeout=5s, cluster.name=Test-Cluster, host.0=localhost, name=importer, port=9300, sniff=false}\r\n[08:05:58,033][INFO ][org.elasticsearch.plugins][pool-3-thread-1] [importer] loaded [], sites []\r\n[08:05:58,504][INFO ][org.xbib.elasticsearch.support.client.BaseTransportClient][pool-3-thread-1] trying to connect to [localhost:9300]\r\n[08:05:58,634][INFO ][org.xbib.elasticsearch.support.client.BaseTransportClient][pool-3-thread-1] connected to [{Node-1}{DjgX6vZVSrGjuaQ32zdVuA}{localhost}{localhost:9300}{master=true}]\r\n[08:05:58,639][INFO ][importer.jdbc.sink.standard][pool-3-thread-1] creating index my_rptinfo with settings =  and mappings = \r\n[08:05:58,688][WARN ][importer.jdbc.sink.standard][pool-3-thread-1] already exists\r\n[08:06:00,772][ERROR][org.xbib.elasticsearch.support.client.transport.BulkTransportClient][elasticsearch[importer][listener][T#1]] bulk [1] error\r\norg.elasticsearch.transport.RemoteTransportException: [Node-1][localhost:9300][indices:data/write/bulk]\r\nCaused by: java.lang.NullPointerException: id must not be null\r\n\tat java.util.Objects.requireNonNull(Objects.java:228) ~[?:1.8.0_45]\r\n\tat org.elasticsearch.action.RoutingMissingException.<init>(RoutingMissingException.java:43) ~[elasticsearch-jdbc-2.0.0.1-uberjar.jar:?]\r\n\tat org.elasticsearch.action.index.IndexRequest.process(IndexRequest.java:609) ~[elasticsearch-jdbc-2.0.0.1-uberjar.jar:?]\r\n\tat org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(TransportBulkAction.java:228) ~[elasticsearch-jdbc-2.0.0.1-uberjar.jar:?]\r\n\t\r\n\t\r\n\r\nHow can i update all child table data to elastic search using the elastic search-jdbc plugin\r\n\r\nThanks,\r\nTara Singh"}}