bboss es v5.0.3.7.8已发布。bboss elasticsearch是一套基于query dsl语法操作访问分布式搜索引擎elasticsearch的o/r mapping开发库,底层基于es restful api。使用bboss es,可以快速编写出访问和操作elasticsearch的程序代码,简单、高效、可靠、安全。bboss es对原生restful api、java orm api、elasticsearch sql都提供了很好的支持。 主要特性和新加功能: 新加功能 索引文档增删改查全部支持对json特殊字符的转义处理 主要特性 1.快速配置、快速上手 快速在工程中导入bboss elasticSearch,bboss es restful组件不依赖elasticsearch官方任何jar文件,兼容所有elasticsearch版本。 maven坐标 dependency> <groupId>com.bbossgroups.plugins</groupId> <artifactId>bboss-elasticsearch-rest</artifactId> <version>5.0.3.7.8</version> </dependency> gradle坐标 compile "com.bbossgroups.plugins:bboss-elasticsearch-rest:5.0.3.7.8" 2.快速配置es地址和认证 对应的配置文件为conf/elasticsearch.properties ## es服务器账号和口令配置 elasticUser=elastic elasticPassword=changeme ## restful http地址和端口配置 集群用逗号分隔:127.0.0.1:9200,127.0.0.1:9201,127.0.0.1:9202,单机就配置一个节点即可 elasticsearch.rest.hostNames=127.0.0.1:9200,127.0.0.1:9201,127.0.0.1:9202 3.快速开发 导入组件 import org.frameworkset.elasticsearch.ElasticSearchHelper; import org.frameworkset.elasticsearch.client.ClientInterface; 健康检查-示例 ClientInterface clientUtil = ElasticSearchHelper.getRestClientUtil(); //返回json格式健康状态 String heath = clientUtil.executeHttp("_cluster/health?pretty",ClientInterface.HTTP_GET); System.out.println(heath); 获取集群状态-示例 ClientInterface clientUtil = ElasticSearchHelper.getRestClientUtil(); //返回json格式集群状态 String state = clientUtil.executeHttp("_cluster/state?pretty",ClientInterface.HTTP_GET); System.out.println(state); Map<String,Object> state = clientUtil.executeHttp("_cluster/state",ClientInterface.HTTP_GET,new MapResponseHandler());//返回map结构 更多使用方法参考文档:高性能elasticsearch ORM开发库使用介绍 源码地址 GitHub:https://github.com/bbossgroups/bboss-elastic 码云:https://gitee.com/bboss/bboss-elastic 完整的demo https://gitee.com/bboss/elasticsearchdemo https://github.com/bbossgroups/elasticsearchdemo 高性能Elasticsearch ORM开发库bboss es 5.0.3.7.8发布下载地址