当前位置:网站首页>Restclient operation index library - initialize restclient

Restclient operation index library - initialize restclient

2022-07-23 08:04:00 Its natural happy clothes

1. introduce es Of RestHighLevelClient rely on :

<!--elasticsearch-->
<dependency>
     <groupId>org.elasticsearch.client</groupId>
     <artifactId>elasticsearch-rest-high-level-client</artifactId>
     <version>7.12.1</version>
</dependency>

2. because SpringBoot default ES The version is 7.6.2, So we need to override the default ES edition : 

3. initialization RestHighLevelClient

return new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://192.168.150.101:9200")
));

 

原网站

版权声明
本文为[Its natural happy clothes]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207222149151016.html