目录
官网API介绍
1、新建maven项目
2、检查elasticsearch依赖的版本
3、配置RestHighLevelClient对象
4、使用springboot-test测试API的使用
官网API介绍
Java API Client
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/index.html
Java REST Client(rest-high-level-client):
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high.html
Java REST Client依赖
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
</dependency>
使用对象操作es
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(文章来源:https://www.toymoban.com/news/detail-492559.html
new HttpHost("localhost", 9200, "http")));文章来源地址https://www.toymoban.com/news/detail-492559.html
到了这里,关于六、SpringBoot集成elasticsearch的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!