当前位置:网站首页>RestHighLevelClient语法
RestHighLevelClient语法
2022-07-21 05:03:00 【iAmZard】
1、统计查询结果:
try {
CountRequest countRequest = new CountRequest();
countRequest.indices(Constants.VOICE_INDEX_NAME);
countRequest.types(Constants.VOICE_TYPE_NAME);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(queryBuilder);
countRequest.source(searchSourceBuilder);
CountResponse countResponse = ElasticSearchClientUtil.getRestClient().count(countRequest, RequestOptions.DEFAULT);
return countResponse!=null?countResponse.getCount():0L;
}catch (Exception e){
LOGGER.error("数据统计异常 e:{}", ExceptionUtils.getFullStackTrace(e));
}
官方6.7版本链接
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.7/java-rest-high.html
边栏推荐
猜你喜欢
Database connection failed
flutter自定义form表单,封装form表单组件
Flutter通过Geolocator定位插件获经纬度调用高德周边信息接口
汇编语言大作业
基于GeoServer开发的地理场景可视化系统
Judge whether there are duplicate values in the "string []" array, and use the HashSet feature to check
类加载器及双亲委派机制
分布式事务其中的那些坑
Wechat public number Development Access, Application for Test number for Local Development Using Wechat public Platform
Classloader and parental delegation mechanism
随机推荐
Quartz创建定时任务(入门)
汇编语言大作业
Project of integrating SSM framework
Idea2020 open run dashboard
[404] the server starts successfully, and the default page cannot be accessed
Redis installation of Linux system
flutter自定义form表单,封装form表单组件
URL 和 URI
868. Number of sieves
RSA公私钥加密工具类
Json工具 将对象转换为json格式字符串
对项目优化之一:redis缓存数据库的安装与项目中使用,加强项目读取操作
拉取项目pom文件报错,jai_core-1.1.3.jar,解决jar引入问题
MySQL DCL (data control language)
Detailed explanation of NiO channel
类加载器及双亲委派机制
【404】服务器启动成功,默认页面无法访问
PyTorch基础模块和实践
MySQL之DCL(数据控制语言)
Linux Redis-6.2.6单机部署