I have a custom method for indexing data into elasticsearch. When i run 
this, i get the error as :* java.lang.NoClassDefFoundError: 
org.elasticsearch.common.settings.ImmutableSettings*
  I have included all the required libraries.

 public void insertIntoElasticsearch(String JsonString, String idAttribute)
    {
         Settings settings = 
ImmutableSettings.settingsBuilder().put("http.enabled", 
"false").put("transport.tcp.port", 
"9300-9400").put("discovery.zen.ping.multicast.enabled", "false")
                                        
.put("discovery.zen.ping.unicast.hosts", "localhost").build();

        TransportClient client = new TransportClient(settings); 
        client.addTransportAddress(new 
InetSocketTransportAddress("localhost",9300)); 
        IndexResponse response = client.prepareIndex("dbdata", 
"type",idAttribute ).setSource(JsonString).execute().actionGet();
        String _id = response.getId();
        System.out.println("-----id-----" + _id + "---------");
        System.out.println("-----Insert Into Elasticsearch-----");
    }


Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/0557a204-ca5d-477b-8fb7-f86e8bcaf1c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to