ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

【easy-es】开源下载和安装教程

【easy-es】开源下载和安装教程 【easy-es】开源下载和安装教程1、项目介绍Easy-Es是一款简化ElasticSearch操作的开源框架提供全自动智能索引托管功能。其语法与Mybatis-Plus高度一致开发者无需额外学习即可快速上手。主要特点包括自动索引管理智能字段类型推断支持ES高级功能分词/高亮/地理位置查询等代码量减少3-80倍完善的单元测试覆盖率95%2、项目下载位置官方推荐通过Maven或Gradle依赖引入Maven中央仓库坐标dependency groupIdorg.dromara.easy-es/groupId artifactIdeasy-es-boot-starter/artifactId version2.0.0/version /dependency源码下载地址Gitee: https://gitee.com/dromara/easy-esGitHub: https://github.com/dromara/easy-es3、环境配置基础环境要求JDK 1.8Elasticsearch 7.x/8.xSpring Boot 2.5.x配置示例application.ymleasy-es: enable: true address: 127.0.0.1:9200 username: elastic password: 1234564、安装方式方式一Spring Boot快速集成添加上述Maven依赖在启动类添加注解EnableEasyEs SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }方式二手动安装下载源码包执行安装命令mvn clean install -DskipTests5、项目处理脚本框架提供自动化索引处理脚本常用操作示例索引初始化脚本IndexName(document) public class Document { IndexId private String id; IndexField(fieldType FieldType.TEXT) private String title; // 其他字段... }CRUD操作示例// 插入文档 documentMapper.insert(document); // 条件查询 ListDocument list documentMapper.selectList( EsWrappers.lambdaQuery(Document.class) .eq(Document::getTitle, 测试) );索引迁移脚本// 自动创建新索引并迁移数据 LambdaEsIndexWrapperDocument wrapper new LambdaEsIndexWrapper(); wrapper.indexName(new_index).createIndex();创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表