使用java访问elasticsearch创建索引
http://riching.iteye.com/blog/1921625 ...怎么这么多对象啊.... 结贴..
1.创建连接elasticsearch服务的client 创建这个服务的客户端
Settings settings = ImmutableSettings.settingsBuilder().put("client.transport.sniff", true).put("cluster.name", "name of node").build();
Client client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress("ip of server", 9300));
Settings 是一个对象 通过一个builder 的put 方法
Client 客户端
2.
时间: 2024-10-11 16:21:43