Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
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
shenjunjie
brandkbs2
Commits
d616bd13
Commit
d616bd13
authored
Sep 25, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
Feature See merge request
!590
parents
6d5b22e0
803cb7f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+28
-4
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+1
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
d616bd13
...
@@ -1011,7 +1011,8 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1011,7 +1011,8 @@ public class MarkDataServiceImpl implements MarkDataService {
map
.
merge
(
title
,
jsonObject
,
(
v1
,
v2
)
->
{
map
.
merge
(
title
,
jsonObject
,
(
v1
,
v2
)
->
{
v1
.
put
(
"num"
,
v1
.
getLongValue
(
"num"
)
+
v2
.
getLongValue
(
"num"
));
v1
.
put
(
"num"
,
v1
.
getLongValue
(
"num"
)
+
v2
.
getLongValue
(
"num"
));
v1
.
put
(
"sourceCount"
,
v1
.
getIntValue
(
"sourceCount"
)
+
v2
.
getIntValue
(
"sourceCount"
));
v1
.
put
(
"sourceCount"
,
v1
.
getIntValue
(
"sourceCount"
)
+
v2
.
getIntValue
(
"sourceCount"
));
v1
.
put
(
"sources"
,
v1
.
getJSONArray
(
"sources"
).
addAll
(
v2
.
getJSONArray
(
"sources"
)));
v1
.
getJSONArray
(
"sources"
).
addAll
(
v2
.
getJSONArray
(
"sources"
));
v1
.
put
(
"sources"
,
v1
.
getJSONArray
(
"sources"
));
return
v1
;
return
v1
;
});
});
}
}
...
@@ -3857,8 +3858,26 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -3857,8 +3858,26 @@ public class MarkDataServiceImpl implements MarkDataService {
AggregationBuilders
.
dateHistogram
(
"timeAgg"
).
field
(
"time"
).
calendarInterval
(
DateHistogramInterval
.
DAY
).
offset
(
"16h"
);
AggregationBuilders
.
dateHistogram
(
"timeAgg"
).
field
(
"time"
).
calendarInterval
(
DateHistogramInterval
.
DAY
).
offset
(
"16h"
);
TermsAggregationBuilder
sourceAggregationBuilder
=
AggregationBuilders
.
terms
(
"sourceAgg"
).
field
(
"source"
).
size
(
10000
);
TermsAggregationBuilder
sourceAggregationBuilder
=
AggregationBuilders
.
terms
(
"sourceAgg"
).
field
(
"source"
).
size
(
10000
);
// response
// response
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
SearchResponse
searchResponse
;
daysAggregationBuilder
.
subAggregation
(
sourceAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
try
{
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
daysAggregationBuilder
.
subAggregation
(
sourceAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
}
catch
(
ElasticsearchStatusException
e
){
Long
startTime
=
dto
.
getStartTime
();
Long
endTime
=
dto
.
getEndTime
();
Long
midTime
=
startTime
+
(
endTime
-
startTime
)
/
2
;
if
(
midTime
-
startTime
<
Constant
.
ONE_DAY
||
endTime
-
midTime
<
Constant
.
ONE_DAY
){
log
.
info
(
"{}-getWholeSearchArticlePoint分割时间至一天bucket仍超出上限"
,
JSONObject
.
toJSONString
(
dto
));
return
jsonObjects
;
}
dto
.
setStartTime
(
startTime
);
dto
.
setEndTime
(
midTime
);
jsonObjects
.
addAll
(
getWholeSearchArticlePoint
(
dto
));
dto
.
setStartTime
(
midTime
);
dto
.
setEndTime
(
endTime
);
jsonObjects
.
addAll
(
getWholeSearchArticlePoint
(
dto
));
return
jsonObjects
;
}
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
ParsedDateHistogram
teamAgg
=
(
ParsedDateHistogram
)
aggMap
.
get
(
"timeAgg"
);
ParsedDateHistogram
teamAgg
=
(
ParsedDateHistogram
)
aggMap
.
get
(
"timeAgg"
);
List
<?
extends
Histogram
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
List
<?
extends
Histogram
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
...
@@ -4331,7 +4350,12 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4331,7 +4350,12 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
query
.
must
(
keywordQuery
);
query
.
must
(
keywordQuery
);
// platform
// platform
BoolQueryBuilder
platformQuery
=
EsQueryTools
.
assemblePlatformQuery
(
GlobalPojo
.
PLATFORMS
);
BoolQueryBuilder
platformQuery
;
if
(
CollectionUtils
.
isEmpty
(
dto
.
getPlatforms
()))
{
platformQuery
=
EsQueryTools
.
assemblePlatformQuery
(
GlobalPojo
.
PLATFORMS
);
}
else
{
platformQuery
=
EsQueryTools
.
assemblePlatformQuery
(
Tools
.
getPlatformByIds
(
dto
.
getPlatforms
()));
}
query
.
must
(
platformQuery
);
query
.
must
(
platformQuery
);
return
query
;
return
query
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
d616bd13
...
@@ -80,7 +80,7 @@ public class Tools {
...
@@ -80,7 +80,7 @@ public class Tools {
/**
/**
* 须过滤的标题
* 须过滤的标题
*/
*/
public
static
final
List
<
String
>
FILTER_TITLE
=
Arrays
.
asList
(
"Notitle"
,
"分享一篇文章"
,
"分享一篇文章。"
,
"暂无标题"
);
public
static
final
List
<
String
>
FILTER_TITLE
=
Arrays
.
asList
(
"Notitle"
,
"分享一篇文章"
,
"分享一篇文章。"
,
"暂无标题"
,
""
);
/**
/**
* 须过滤的渠道
* 须过滤的渠道
...
...
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