Ver código fonte

feat:高亮关键词

wangshan 2 anos atrás
pai
commit
a5dab7d951

+ 1 - 1
jyBXCore/rpc/entity/search.go

@@ -164,7 +164,7 @@ func (kws *KeyWordsSearch) GetSearchKeyWordsQueryStr(in *bxcore.SearchReq) (word
 		for _, awv := range strings.Split(in.AdditionalWords, ",") {
 			for _, av := range strings.Split(awv, IC.C.JYKeyMark) {
 				if strings.TrimSpace(av) != "" {
-					words = append(words, strings.Split(in.KeyWords, IC.C.JYKeyMark)...)
+					words = append(words, strings.Split(av, IC.C.JYKeyMark)...)
 				}
 			}
 		}

+ 1 - 0
jyBXCore/rpc/model/es/search.go

@@ -109,6 +109,7 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
 	} else if len(wordsMusts) > 0 {
 		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(wordsMusts, ",")))
 	}
+	//行业
 	if in.Industry != "" {
 		musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`))
 	}

+ 2 - 2
jyBXCore/rpc/util/search.go

@@ -93,8 +93,8 @@ func InterceptSearchKW(word string, keywordsLimit int, isFilter bool) (bWord, aW
 		} else {
 			aWord = string(words[keywordsLimit:])
 		}
-	} else {
-		bWord = word
+		//} else {
+		//	bWord = word
 	}
 	aWord = strings.TrimSpace(aWord)
 	sWord = MatchSpace.ReplaceAllString(bWord, IC.C.JYKeyMark)