title: The constructor TransportClient() is undefined?
body: <p>I am working on elastic search using mongo db. When importing transport client it shows </p>
  
  <blockquote>
    <p>The constructor TransportClient() is undefined. </p>
  </blockquote>
  
  <p>I configured it as follows:</p>
  
  <pre><code>package com.appointment.api.mobile.config;
  
  import javax.annotation.Resource;
  
  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.Configuration;
  import org.springframework.context.annotation.PropertySource;
  import org.springframework.core.env.Environment;
  import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
  import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
  import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
  
  @Configuration
  @PropertySource(value = "classpath:elasticsearch.properties")
  @EnableElasticsearchRepositories(basePackages = "com.appointment.api")
  public class ElasticsearchConfiguration {
  
      @Resource
      private Environment environment;
  
      @Bean
      public Client client() {
          TransportClient client = new TransportClient();
       /*   TransportAddress address = new InetSocketTransportAddress(environment.getProperty("elasticsearch.host"), Integer.parseInt(environment.getProperty("elasticsearch.port")));
          client.addTransportAddress(address); */
          return client;
      }
  
      @Bean
      public ElasticsearchOperations elasticsearchTemplate() {
          return new ElasticsearchTemplate(client());
      }
  
  
  }
  </code></pre>
  
  <p>dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-elasticsearch&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Project:</p>
  
  <pre><code>Spring boot maven project.
  </code></pre>