In my spring-boot project, I use spring-data-easticsearch 4.4.5
to connect to the elasticsearch 8.4.3
. Now I have to connect to another very old elasticsearch 2.4
. But according to the doc this version of spring data does not support ES 2.4. How can I connect to this new ES without altering current configuration?
Here are my configs and repos
public class EsConfig extends ElasticsearchConfiguration {
//
@Override
public ClientConfiguration clientConfiguration() {
ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo(esUrl)
.usingSsl()
.withBasicAuth(esUserName, esPassword)
.withConnectTimeout(Duration.ofMillis(connectionTimeout))
.withSocketTimeout(Duration.ofMillis(socketTimeout))
.build();
return clientConfiguration;
}
}
and
@Repository
public interface MyRepository extends ElasticsearchRepository<MyEntity, String> {
///
}