java中的ES操作语法分组
发表于:2025-12-04 作者:千家信息网编辑
千家信息网最后更新 2025年12月04日,本篇内容介绍了"java中的ES操作语法分组 "的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
千家信息网最后更新 2025年12月04日java中的ES操作语法分组
本篇内容介绍了"java中的ES操作语法分组 "的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
public ListsearchGroupChenQ(List tids, List keywords) { String key = "tid"; String[] strings = new String[keywords.size()]; keywords.toArray(strings); SearchSourceBuilder bulder = new SearchSourceBuilder(); BoolQueryBuilder should = QueryBuilders.boolQuery().must(QueryBuilders.termsQuery("content", keywords)) .must(QueryBuilders.termsQuery("tid", tids)); bulder.query(should); IncludeExclude includeExclude = new IncludeExclude(strings, null); TermsAggregationBuilder agg = AggregationBuilders.terms("tids").field(key) .subAggregation(AggregationBuilders.terms("keywords").field("content").includeExclude(includeExclude) .subAggregation(AggregationBuilders.topHits("topHits") .fetchSource(new String[]{"tid", "tname", "dname"}, new String[]{"did", "title", "cityid", "cityName", "content", "createDate"}) .size(5))); bulder.aggregation(agg).size(0); List value = baseElasticService.searchGroupChenQ("notice_info_new", bulder); return value; } public List searchGroupChenQNew(List tids, List keywords) { String key = "tid"; String[] strings = new String[keywords.size()]; keywords.toArray(strings); SearchSourceBuilder bulder = new SearchSourceBuilder(); BoolQueryBuilder should = QueryBuilders.boolQuery().must(QueryBuilders.termsQuery("content", keywords)) .must(QueryBuilders.termsQuery("tid", tids)); bulder.query(should); IncludeExclude includeExclude = new IncludeExclude(strings, null); TermsAggregationBuilder agg = AggregationBuilders.terms("tids").field(key) .subAggregation(AggregationBuilders.terms("keywords").field("content").includeExclude(includeExclude) .subAggregation(AggregationBuilders.topHits("topHits") .fetchSource(new String[]{"tid", "tname", "dname"}, new String[]{"did", "title", "cityid", "cityName", "content", "createDate"}) .size(5))); bulder.aggregation(agg).size(0); List value = baseElasticService.searchGroupChenQNew("notice_info_new", bulder); return value; }
"java中的ES操作语法分组 "的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!
语法
分组
内容
更多
知识
实用
学有所成
接下来
困境
实际
情况
文章
案例
编带
网站
行业
过程
高质量
学习
有关
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
电梯优迈服务器怎么用
工信部高级网络技术工程师证书
服务器dl380 usb启动
地下城与勇士新服务器上线
英特尔软件开发人员占比
怎么在登录页面引入数据库
软件开发平均月工资
服务器管理器 在哪
国内网络技术最先进的大学
旷视科技算互联网公司吗
网络技术编程的不足总结
机床数据库
电脑显示无网络安全是什么意思
linux系统软件开发工具
服务器加载apk
数据库怎么删除列
刷脸支付软件开发教程
服务器基础配置
计算机网络技术模拟局域网
甘肃省网络安全视频
无线网络技术第四版
数据库视图介绍
苏州五指互联网络科技旗下游戏
网上换服务器注意事项
郑州铁路网络安全知识考试
微信小程序 访问阿里云数据库
个人建服务器如何保证安全
本机连接服务器
简述网络安全技术的种类
上海2020网络安全宣传周主题