class LegacyElasticsearchConfig {

    @Bean(name = "legacyRestHighLevelClient", destroyMethod = "close")
    public RestHighLevelClient buildRestClient() {
        RestHighLevelClient elasticsearchClient = new RestHighLevelClient(buildRestClientBuilder());
        return elasticsearchClient;
    }

}