系统查询速度慢,就想用elasticsearch增加查询速度。并且能把pdf,csv 导入到elasticsearch.
系统使用了springboot版本号是.2.0.6.RELEASE。那么首先要确认elasticsearch的版本号
........
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
......
在intellij idea 的maven包里面可以看到版本号
SpringBoot 2.0.6版本对应的是es5.6.12的版本
那么就是
1.spring boot 2.0.6
2.jdk8
3.elastic search 版本号:5.6.12
4.elasticsearch-head(可视化插件,为了不出错,要和elastic search版本号一致),版本号:5.6.12
5.logstash-5.6.12。能导入mysql(或其他数据库),csv到elastic search
6.fscrawler-es5-2.6。可以导入pdf,word文件。
参考网站
1.参考代码(稍微修改):https://github.com/fonxian/spring-elasticsearch-example
2.elastic search,logstash都是在这里下载: