当前位置:网站首页>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)
边栏推荐
- 小程序直播 + 电商,想做新零售电商就用它吧!
- What you learned in the eleventh week
- 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
- [FPGA tutorial case 10] design and implementation of complex multiplier based on Verilog
- College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
- 【FPGA教程案例10】基于Verilog的复数乘法器设计与实现
- 【CTF】AWDP总结(Web)
- BGP comprehensive experiment
- Arbitrum: two-dimensional cost
- [FPGA tutorial case 9] design and implementation of clock manager based on vivado core
猜你喜欢
Playwright recording
Nebula importer data import practice
微信小程序:全网独家小程序版本独立微信社群人脉
Hedhat firewall
Single step debugging of master data reading of SAP commerce cloud products
107. SAP UI5 OverflowToolbar 容器控件以及 resize 事件处理的一些细节介绍
【海浪建模2】三维海浪建模以及海浪发电机建模matlab仿真
Take you ten days to easily complete the go micro service series (IX. link tracking)
Remote control service
Yyds dry goods inventory kubernetes management business configuration methods? (08)
随机推荐
实战模拟│JWT 登录认证
Inventory of more than 17 typical security incidents in January 2022
Les phénomènes de « salaire inversé » et de « remplacement des diplômés » indiquent que l'industrie des tests a...
Jcenter () cannot find Alibaba cloud proxy address
Global and Chinese market of nutrient analyzer 2022-2028: Research Report on technology, participants, trends, market size and share
19. Delete the penultimate node of the linked list
Analysis and comparison of leetcode weekly race + acwing weekly race (t4/t3)
Basic operations of database and table ----- delete index
[Yocto RM]11 - Features
Query for Boolean field as "not true" (e.g. either false or non-existent)
node工程中package.json文件作用是什么?里面的^尖括号和~波浪号是什么意思?
潘多拉 IOT 开发板学习(RT-Thread)—— 实验4 蜂鸣器+马达实验【按键外部中断】(学习笔记)
微信小程序:星宿UI V1.5 wordpress系统资讯资源博客下载小程序微信QQ双端源码支持wordpress二级分类 加载动画优化
【CTF】AWDP总结(Web)
[development of large e-commerce projects] performance pressure test - Optimization - impact of middleware on performance -40
When the industrial Internet era is truly developed and improved, it will witness the birth of giants in every scene
Pandora IOT development board learning (RT thread) - Experiment 4 buzzer + motor experiment [key external interrupt] (learning notes)
Compare whether two lists are equal
Call Huawei order service to verify the purchase token interface and return connection reset
Yyds dry goods inventory [Gan Di's one week summary: the most complete and detailed in the whole network]; detailed explanation of MySQL index data structure and index optimization; remember collectio