当前位置:网站首页>es使用collapseBuilder去重和只返回某个字段
es使用collapseBuilder去重和只返回某个字段
2022-07-05 01:15:00 【talen_hx296】
去重
SearchRequest searchRequest = new SearchRequest(esIndices2.toArray(new String[esIndices2.size()]));
// 构建搜索条件
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
//指定去重字段
CollapseBuilder collapseBuilder = new CollapseBuilder("userName.keyword");
searchRequest.source(sourceBuilder.query(boolBuilder).collapse(collapseBuilder).trackTotalHits(true));指定字段
earchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.fetchSource("userName", null)边栏推荐
- Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention
- Complex, complicated and numerous: illustration of seven types of code coupling
- 当产业互联网时代真正发展完善之后,将会在每一个场景见证巨头的诞生
- Call Huawei order service to verify the purchase token interface and return connection reset
- 19. Delete the penultimate node of the linked list
- Redis(1)之Redis简介
- Global and Chinese market of network connected IC card smart water meters 2022-2028: Research Report on technology, participants, trends, market size and share
- Research Report on the overall scale, major producers, major regions, products and application segmentation of agricultural automatic steering system in the global market in 2022
- Yyds dry goods inventory kubernetes management business configuration methods? (08)
- SAP ui5 application development tutorial 106 - how to improve the readability of SAP ui5 application routing URL trial version
猜你喜欢

“薪资倒挂”、“毕业生平替” 这些现象说明测试行业已经...

What if the programmer's SQL data script coding ability is weak and Bi can't do it?

Playwright recording

POAP:NFT的采用入口?

Basic operation of database and table ----- phased test II

Actual combat simulation │ JWT login authentication

【海浪建模1】海浪建模的理论分析和matlab仿真

The performance of major mainstream programming languages is PK, and the results are unexpected

Basic operations of database and table ----- delete index

Senior Test / development programmers write no bugs? Qualifications (shackles) don't be afraid of mistakes
随机推荐
Hedhat firewall
Async/await you can use it, but do you know how to deal with errors?
Package What is the function of JSON file? What do the inside ^ angle brackets and ~ tilde mean?
pycharm专业版下载安装教程
Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention
ROS command line tool
JS implementation determines whether the point is within the polygon range
[wave modeling 3] three dimensional random real wave modeling and wave generator modeling matlab simulation
【海浪建模1】海浪建模的理论分析和matlab仿真
SAP UI5 应用的主-从-从(Master-Detail-Detail)布局模式的实现步骤
User login function: simple but difficult
Grabbing and sorting out external articles -- status bar [4]
微信小程序:全网独家小程序版本独立微信社群人脉
Chia Tai International Futures: what is the master account and how to open it?
無心劍英譯席慕容《無怨的青春》
揭露测试外包公司,关于外包,你或许听到过这样的声音
Database performance optimization tool
Wechat applet: wechat applet source code download new community system optimized version support agent member system function super high income
107. SAP UI5 OverflowToolbar 容器控件以及 resize 事件处理的一些细节介绍
Maximum number of "balloons"