当前位置:网站首页>RestClient操作索引库-初始化RestClient
RestClient操作索引库-初始化RestClient
2022-07-22 21:49:00 【其然乐衣】
1.引入es的RestHighLevelClient依赖:
<!--elasticsearch-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.12.1</version>
</dependency>2.因为SpringBoot默认的ES版本是7.6.2,所以我们需要覆盖默认的ES版本:

3.初始化RestHighLevelClient:
return new RestHighLevelClient(RestClient.builder(
HttpHost.create("http://192.168.150.101:9200")
));
边栏推荐
猜你喜欢
随机推荐
如何保护 JDBC 应用程序免受 SQL 注入
数据库基础及安装
使用路由协议配置 IPv6 over IP手动隧道
LAN SDN hard core technology insider 17 from one to 100
matlab ode45求解微分方程
golang--module
Kubernetes 部署策略
[original dry goods] found a useful tool for data analysis
Flick batch reading es
The boss asked me to do an IP territorial function and an open source library!
Etcdv3 · watch operation implementation and relevant key instructions
Scala Generic 泛型类详解 - T
scala idea提示函数参数
Simulate not all endpoints registered exceptions and Solutions
The new idea 2022.2 was officially released, and the new features are really fragrant
初出茅庐的小李第109篇博客之如何打开Keil中文件的真是路径
yolov5 test.py BrokenPipeError: [Errno 32] Broken pipe问题解决
JVM监控工具介绍jstack, jconsole, jinfo, jmap, jdb, jstat
文件上传,服务器文件名中文乱码文件上传,服务器文件名中文乱码
LeetCode(剑指 Offer)- 11. 旋转数组的最小数字









