title: Elastic Search TransportClient
body: <p>I am using <code>ElasticSearch</code> Java client to query elastic search. I am initializing transport client every time I have to make a call. Is this the right way or should I initialize once during the start of the application and close it at shutdown.</p>
  
  <p>Following is the code to initialize client</p>
  
  <pre><code> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", Config.getEsClusterName()).put("client.transport.ignore_cluster_name", true).build();
   Client esClient = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(Config.getEsHost(), Config.getEsPort()));
  </code></pre>