mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-09-26 20:11:20 +08:00
Compare commits
5 Commits
d550942cd2
...
2e37eae3ca
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2e37eae3ca | ||
![]() |
9f7f0c9dd7 | ||
![]() |
1102a60425 | ||
![]() |
8a29bf610c | ||
![]() |
056caf5d06 |
@@ -3,7 +3,6 @@ package es
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -84,16 +83,15 @@ 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.NewMatchQuery("log", v.Content).Boost(2))
|
||||||
|
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:
|
||||||
notQuery = append(notQuery, elastic.NewWildcardQuery("log.keyword", "*"+v.Content+"*"))
|
notQuery = append(notQuery, elastic.NewWildcardQuery("log.keyword", "*"+v.Content+"*"))
|
||||||
}
|
}
|
||||||
fmt.Printf("v.Cond: %v\n", v.Cond)
|
|
||||||
fmt.Printf("v.Content: %v\n", v.Content)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Match.Name != "" {
|
if req.Match.Name != "" {
|
||||||
|
Reference in New Issue
Block a user