title: correct use of TransportClient for elasticsearch
body: <p>I have a problem with creating the TransportClient bean for elastic search the compiller it says that the constructor is private, and it is like that. How i can correctly create the bean?
  Here is my config class:</p>
  
  <pre><code>import org.elasticsearch.client.Client;
  import org.elasticsearch.client.transport.TransportClient;
  import org.elasticsearch.common.transport.InetSocketTransportAddress;
  import org.elasticsearch.common.transport.TransportAddress;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
  import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
  import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
  
  @Configuration
  @EnableElasticsearchRepositories(basePackages = "example.spring.data.es.repository")
  @ComponentScan(basePackages = { "example.spring.data.es.service" })
  public class Config {
  
  @Bean
  public Client client() {
  //here compiller says that the TransportClient() is private. How else i cna create the transport client?
      TransportClient client = new TransportClient();
  
      TransportAddress address = new InetSocketTransportAddress(
              "localhost",9200);
      client.addTransportAddress(address);
      return client;
  }
  
  @Bean
  public ElasticsearchOperations elasticsearchTemplate() {
      return new ElasticsearchTemplate(client());
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The elastic search dependency is: elasticsearch-2.4.2</p>