Explorar o código

feat:修改二次分词

wangchuanjin %!s(int64=2) %!d(string=hai) anos
pai
achega
88a3b0a0a5
Modificáronse 1 ficheiros con 1 adicións e 19 borrados
  1. 1 19
      jyBXCore/rpc/util/search.go

+ 1 - 19
jyBXCore/rpc/util/search.go

@@ -5,8 +5,6 @@ import (
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/internal/config"
 	"jyBXCore/rpc/type/bxcore"
-	"net/http"
-	"net/url"
 	"regexp"
 	"strconv"
 	"strings"
@@ -99,23 +97,7 @@ func InterceptSearchKW(word string, keywordsLimit int, isFilter bool) (bWord, aW
 }
 
 func HttpEs(ques, analyzer, esAddress string) (res string) {
-	return es.Analyze(ques, "bidding", analyzer)
-}
-
-func getESResp(ques, analyzer string, adds []string) (resp *http.Response, err error) {
-	for _, v := range adds {
-		curl := v + "/bidding/_analyze"
-		URL, _ := url.Parse(curl)
-		Q := URL.Query()
-		Q.Add("text", ques)
-		Q.Add("analyzer", analyzer)
-		URL.RawQuery = Q.Encode()
-		resp, err = http.Get(URL.String())
-		if err == nil {
-			break
-		}
-	}
-	return resp, err
+	return strings.ReplaceAll(es.Analyze(ques, "bidding", analyzer), "+", IC.C.JYKeyMark)
 }
 
 const (