一、使用前设置

1、elasticsearch开启

cmd下,进入安装目录

cd D:\developToool\elasticsearch-5.4.3
elasticsearch  
# 或者后台运行
elasticsearch -d

校验安装成功:http://127.0.0.1:9200/

查看集群健康:http://127.0.0.1:9200/_cat/health?v

查看集群节点:http://127.0.0.1:9200/_cat/nodes?v

查看索引信息:http://127.0.0.1:9200/_cat/indices?v

2、elasticsearch-header

cd D:\developToool\elasticsearch-head
npm run start

校验:http://127.0.0.1:9100/

二、spring对接

由于服务器端版本使用5.4.3。故客户端使用此版本

环境配置
  ES版本:5.4.3
  spring-data-elasticsearch:3.0.0.RELEASE
  spring:5.0.1.RELEASE

2.1、maven配置

            <dependency>
                <groupId>org.elasticsearch.client</groupId>
                <artifactId>transport</artifactId>
                <version>${es.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-elasticsearch</artifactId>
                <version>${spring.es.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.elasticsearch</groupId>
                        <artifactId>elasticsearch</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.elasticsearch.client</groupId>
                        <artifactId>transport</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-tx</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-beans</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
View Code

相关文章:

  • 2022-02-10
  • 2021-10-21
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
  • 2021-11-26
  • 2021-10-20
  • 2021-06-28
  • 2022-12-23
相关资源
相似解决方案