Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
b4a16368
Commit
b4a16368
authored
Nov 14, 2023
by
李科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 告警列表,关键词模糊搜索
parent
b7669d9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
src/service/alert.go
src/service/alert.go
+4
-5
No files found.
src/service/alert.go
View file @
b4a16368
...
@@ -426,11 +426,10 @@ func (a *AlertSvc) DocSearch(req request.ListAlert) (resp response.AlertList, er
...
@@ -426,11 +426,10 @@ func (a *AlertSvc) DocSearch(req request.ListAlert) (resp response.AlertList, er
// 请输入预警点/分类/指标
// 请输入预警点/分类/指标
if
req
.
Keyword
!=
""
{
if
req
.
Keyword
!=
""
{
subBoolQuery
:=
elastic
.
NewBoolQuery
()
subBoolQuery
:=
elastic
.
NewBoolQuery
()
//subBoolQuery.Should(elastic.NewMultiMatchQuery(req.Keyword, "alert_point", "class_parent_name", "class_name", "metric_config_name"))
subBoolQuery
.
Should
(
elastic
.
NewWildcardQuery
(
"alert_point.keyword"
,
fmt
.
Sprintf
(
"*%s*"
,
req
.
Keyword
)))
subBoolQuery
.
Should
(
elastic
.
NewPrefixQuery
(
"alert_point.keyword"
,
req
.
Keyword
))
subBoolQuery
.
Should
(
elastic
.
NewWildcardQuery
(
"class_parent_name.keyword"
,
fmt
.
Sprintf
(
"*%s*"
,
req
.
Keyword
)))
subBoolQuery
.
Should
(
elastic
.
NewPrefixQuery
(
"class_parent_name.keyword"
,
req
.
Keyword
))
subBoolQuery
.
Should
(
elastic
.
NewWildcardQuery
(
"class_name.keyword"
,
fmt
.
Sprintf
(
"*%s*"
,
req
.
Keyword
)))
subBoolQuery
.
Should
(
elastic
.
NewPrefixQuery
(
"class_name.keyword"
,
req
.
Keyword
))
subBoolQuery
.
Should
(
elastic
.
NewWildcardQuery
(
"metric_config_name.keyword"
,
fmt
.
Sprintf
(
"*%s*"
,
req
.
Keyword
)))
subBoolQuery
.
Should
(
elastic
.
NewPrefixQuery
(
"metric_config_name.keyword"
,
req
.
Keyword
))
boolQuery
.
Must
(
subBoolQuery
)
boolQuery
.
Must
(
subBoolQuery
)
}
}
...
...
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