bboss es v5.0.3.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>com.bbossgroups.plugins bboss-elasticsearch-rest 5.0.3.8
gradle坐标
compile "com.bbossgroups.plugins:bboss-elasticsearch-rest:5.0.3.8"
2.快速配置es地址和认证
对应的配置文件为
## 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);
mapstate = clientutil.executehttp("_cluster/state",clientinterface.http_get,new mapresponsehandler());//返回map结构
更多使用方法参考文档:
源码地址
github:
码云:
完整的demo
bboss es对比直接使用es客户端的优势
3 楼 yin_bp 2017-12-09 21:08
bboss es restful组件不依赖elasticsearch官方任何jar文件,兼容所有elasticsearch版本。
maven坐标
xml代码
gradle坐标
compile "com.bbossgroups.plugins:bboss-elasticsearch-rest:5.0.3.8.6"
2 楼 yin_bp 2017-11-28 08:34
bboss es restful组件不依赖elasticsearch官方任何jar文件,兼容所有elasticsearch版本。
maven坐标
xml代码
gradle坐标
compile "com.bbossgroups.plugins:bboss-elasticsearch-rest:5.0.3.8.3"
1 楼 yin_bp 2017-11-24 20:41
bboss es restful组件不依赖elasticsearch官方任何jar文件,兼容所有elasticsearch版本。
maven坐标
gradle坐标
compile "com.bbossgroups.plugins:bboss-elasticsearch-rest:5.0.3.8.1"