elasticsearch 7.17.5 client配置

elasticSearch 7.17.5 client如何书写配置类

 
@Configuration
public class ElasticSearchConfig {
 
    //请求地址:127.0.0.1
    @Value("${es.address}")
    private String address;

    //端口号:9200
    @Value("${es.host}")
    private Integer host;

     //请求协议:http || https
    @Value("${es.protocol}")
    private String protocol;

    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(new HttpHost(address,host,protocol))
        );
        return client;
    }
}