edit es search rule

This commit is contained in:
lzh
2025-09-03 16:34:19 +08:00
parent d550942cd2
commit 056caf5d06

View File

@@ -84,9 +84,9 @@ func (e *esSearch) Search(req model.GetLogReq, filterProcessName ...string) mode
for _, v := range sr.QueryStringAnalysis(req.Match.Log) { for _, v := range sr.QueryStringAnalysis(req.Match.Log) {
switch v.Cond { switch v.Cond {
case sr.Match: case sr.Match:
queryList = append(queryList, elastic.NewMatchQuery("log", v.Content)) queryList = append(queryList, elastic.NewMatchPhraseQuery("log", v.Content))
case sr.NotMatch: case sr.NotMatch:
notQuery = append(notQuery, elastic.NewMatchQuery("log", v.Content)) notQuery = append(notQuery, elastic.NewMatchPhraseQuery("log", v.Content))
case sr.WildCard: case sr.WildCard:
queryList = append(queryList, elastic.NewWildcardQuery("log.keyword", "*"+v.Content+"*")) queryList = append(queryList, elastic.NewWildcardQuery("log.keyword", "*"+v.Content+"*"))
case sr.NotWildCard: case sr.NotWildCard: