Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
878fde0e
Commit
878fde0e
authored
Jul 25, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)设置聚合数量
parent
9adf3fec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
ZLDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/ZLDPStatisticsServiceImpl.java
+2
-4
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZLDPStatisticsServiceImpl.java
View file @
878fde0e
...
...
@@ -465,9 +465,7 @@ public class ZLDPStatisticsServiceImpl {
String
orgCode
=
getAndSetOrgCode
(
screenDto
.
getCityCode
());
searchSourceBuilder
.
query
(
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
)));
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
terms
(
"USE_SITE_CODE"
).
field
(
"USE_SITE_CODE"
)
);
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
terms
(
"count_by_use_site_code"
).
field
(
"USE_SITE_CODE"
).
size
(
20
));
searchRequest
.
source
(
searchSourceBuilder
);
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
returnList
=
new
ArrayList
<>();
...
...
@@ -476,7 +474,7 @@ public class ZLDPStatisticsServiceImpl {
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
// 获取所有聚合结果
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
Terms
termsResult
=
aggregations
.
get
(
"
USE_SITE_CODE
"
);
Terms
termsResult
=
aggregations
.
get
(
"
count_by_use_site_code
"
);
for
(
Terms
.
Bucket
bucket
:
termsResult
.
getBuckets
())
{
String
category
=
bucket
.
getKeyAsString
();
// 或者使用 bucket.getKey() 对于非字符串类型
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment