title: Is it possible to set up multiple cluster in spring data elastic search?
body: <p>We have a use case where we want to use certain indices in different cluster so as to improve performance.
  We are using java based configuration for elasticsearch.</p>
  
  <pre><code>@Log4j
  @Configuration
  @EnableElasticsearchRepositories(basePackages = ["com.as.core.repositories"])
  class ElasticSearchConfig {
  
  @Bean
  ElasticsearchOperations elasticsearchTemplate() {
      Client client
      Settings settings
  
  
      InetSocketTransportAddress inetSocketTransportAddress = new InetSocketTransportAddress(
              Holders.config.grails.elasticsearch.transportClientIP as String,
              Holders.config.grails.elasticsearch.transportClientPort as Integer
      )
  
          settings = ImmutableSettings.settingsBuilder()
                  .put("cluster.name", "elasticsearch")
                  .build()
          client = new TransportClient(settings)
                  .addTransportAddress(inetSocketTransportAddress)
  
  
  
      return new ElasticsearchTemplate(client)
      }
  }
  </code></pre>
  
  <ul>
  <li>Is there any way so that we can add configurations of a different elastic-search cluster?</li>
  <li>Spring data automatically creates indices in the specified cluster. How is the creation of indices managed in multi cluster application?</li>
  </ul>
  
  <p>What I have googled is there is method <code>addTransportAddresses(inetSocketTransportAddress)</code> which allow us to add an array of elastic search server addresses. </p>
  
  <ul>
  <li>But how will we specify multiple cluster names?</li>
  </ul>