1. 程式人生 > >[轉載]springboot中ElasticSearch入門與進階:組合查詢、Aggregation聚合查詢(你想要的都有)

[轉載]springboot中ElasticSearch入門與進階:組合查詢、Aggregation聚合查詢(你想要的都有)

原文:https://blog.csdn.net/topdandan/article/details/81436141

1.springboot中配置elasticSearch

1.1在工程中引入相關的jar包 

 1.1.1 在build.gradle中新增需要的jar包

      我建立的gradle工程,對應的maven工程也是一樣,新增對應的jar包即可

// 新增  Spring Data Elasticsearch 的依賴
compile('org.springframework.boot:spring-boot-starter-data-elasticsearch')
 
// 新增  JNA 的依賴,java訪問當前作業系統需要的包
compile('net.java.dev.jna:jna:4.3.0')