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
b57cf324
Commit
b57cf324
authored
Apr 27, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整情报预警配置2
parent
88b936b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
+4
-6
No files found.
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
View file @
b57cf324
...
@@ -329,24 +329,22 @@ public class EsQueryTools {
...
@@ -329,24 +329,22 @@ public class EsQueryTools {
}
}
public
static
void
addSensitiveChannel
(
BrandkbsYuQingConfig
config
,
BoolQueryBuilder
boolQueryBuilder
)
{
public
static
void
addSensitiveChannel
(
BrandkbsYuQingConfig
config
,
BoolQueryBuilder
boolQueryBuilder
)
{
BoolQueryBuilder
hitBoolQuery
=
QueryBuilders
.
boolQuery
();
if
(!
Tools
.
isEmpty
(
config
.
getPoliticsLevels
()))
{
if
(!
Tools
.
isEmpty
(
config
.
getPoliticsLevels
()))
{
List
<
String
>
hitList
=
config
.
getPoliticsLevels
();
List
<
String
>
hitList
=
config
.
getPoliticsLevels
();
if
(
config
.
getPoliticsLevels
().
contains
(
"全部"
))
{
if
(
config
.
getPoliticsLevels
().
contains
(
"全部"
))
{
hitList
=
ChannelType
.
POLITICS_LEVELS
;
hitList
=
ChannelType
.
POLITICS_LEVELS
;
}
}
BoolQueryBuilder
politicsLevelBool
=
QueryBuilders
.
boolQuery
();
hitList
.
forEach
(
politicsLevel
->
hitBoolQuery
.
should
(
QueryBuilders
.
termQuery
(
GenericAttribute
.
ES_SENSITIVE_CHANNEL
+
"."
+
GenericAttribute
.
ES_POLITICS_LEVEL
+
".keyword"
,
politicsLevel
)));
hitList
.
forEach
(
politicsLevel
->
politicsLevelBool
.
should
(
QueryBuilders
.
termQuery
(
GenericAttribute
.
ES_SENSITIVE_CHANNEL
+
"."
+
GenericAttribute
.
ES_POLITICS_LEVEL
+
".keyword"
,
politicsLevel
)));
boolQueryBuilder
.
must
(
politicsLevelBool
);
}
}
if
(!
Tools
.
isEmpty
(
config
.
getFields
()))
{
if
(!
Tools
.
isEmpty
(
config
.
getFields
()))
{
List
<
String
>
hitList
=
config
.
getFields
();
List
<
String
>
hitList
=
config
.
getFields
();
if
(
config
.
getFields
().
contains
(
"全部"
))
{
if
(
config
.
getFields
().
contains
(
"全部"
))
{
hitList
=
ChannelType
.
COMMON_FIELDS
;
hitList
=
ChannelType
.
COMMON_FIELDS
;
}
}
BoolQueryBuilder
fieldBool
=
QueryBuilders
.
boolQuery
();
hitList
.
forEach
(
field
->
hitBoolQuery
.
should
(
QueryBuilders
.
termQuery
(
GenericAttribute
.
ES_SENSITIVE_CHANNEL
+
"."
+
GenericAttribute
.
ES_FIELD
+
".keyword"
,
field
)));
hitList
.
forEach
(
field
->
fieldBool
.
should
(
QueryBuilders
.
termQuery
(
GenericAttribute
.
ES_SENSITIVE_CHANNEL
+
"."
+
GenericAttribute
.
ES_FIELD
+
".keyword"
,
field
)));
boolQueryBuilder
.
must
(
fieldBool
);
}
}
boolQueryBuilder
.
must
(
hitBoolQuery
);
}
}
public
static
void
addSensitiveChannel
(
String
politicsLevel
,
String
field
,
String
region
,
String
mainBodyType
,
BoolQueryBuilder
boolQueryBuilder
)
{
public
static
void
addSensitiveChannel
(
String
politicsLevel
,
String
field
,
String
region
,
String
mainBodyType
,
BoolQueryBuilder
boolQueryBuilder
)
{
...
...
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