SpringBoot整合Easy-Es

目录

一、什么是Easy-Es

 二、使用场景

2.1 检索类服务

2.2  问答类服务(本质上也是检索类) 

 2.3 地图类服务

三、spring boot整合 Easy-Es

3.1 pom.xml

3.2 配置文件

3.3 创建、删除、查询索引

3.4 创建一个实体类

3.5 新建Mapper类,类似Mybatis的dao

3.6 启动类扫描 dao

四、代码展示

五、 原生Api调用

5.1查看索引mapping关系

5.2查看某个文档,具体字段的分词


一、什么是Easy-Es

    Easy-Es(简称EE)是一款基于ElasticSearch(简称Es)官方提供的RestHighLevelClient打造的ORM开发框架,在 RestHighLevelClient 的基础上,只做增强不做改变,为简化开发、提高效率而生,您如果有用过Mybatis-Plus(简称MP),那么您基本可以零学习成本直接上手EE,EE是MP的Es平替版,在有些方面甚至比MP更简单,同时也融入了更多Es独有的功能,助力您快速实现各种场景的开发.

 二、使用场景

2.1 检索类服务

  • 搜索文库
  • 电商商品检索
  • 海量系统日志检索

2.2  问答类服务(本质上也是检索类) 

  • 在线智能客服
  • 机器人

 2.3 地图类服务

  • 打车app
  • 外卖app
  • 社区团购配送
  • 陌生人社交

 2.4 官网

https://www.easy-es.cn/

三、spring boot整合 Easy-Es

3.1 pom.xml

其中easy-es-boot-starter 安装最新版,可以复制easy-es-boot-starter到maven中央仓库搜索

 <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.elasticsearch.client</groupId>
                    <artifactId>elasticsearch-rest-high-level-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.elasticsearch</groupId>
                    <artifactId>elasticsearch</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
 
        <dependency>
            <groupId>cn.easy-es</groupId>
            <artifactId>easy-es-boot-starter</artifactId>
            <version>2.0.0-beta1</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.14.0</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.14.0</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId&
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

今天的接口写完了吗?

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值