I recently made the switch from elasticsearch 1.7 to 2.0, and I noticed how you changed the client setting. I looked through the documentation and for some reason the client is always null. I was wondering if I configured it correctly.
Here is my code:
Client client = null; try { client = TransportClient.builder().build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300)); } catch (Exception e) { Logger.log(e); } finally { client.close(); try { conn.close(); } catch (SQLException e) { Logger.log(e); } }
java elasticsearch
Daniel Buckle
source share