浏览代码

feat:高亮关键词

wangshan 2 年之前
父节点
当前提交
1063384f96
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      jyBXCore/rpc/entity/search.go
  2. 2 2
      jyBXCore/rpc/internal/logic/getsearchlistlogic.go
  3. 2 2
      jyBXCore/rpc/util/search.go

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

@@ -28,7 +28,7 @@ func NewKeyWordsSearch() *KeyWordsSearch {
 // IsEmptySearch  是否是空搜索,如果是空搜索查缓存数据
 // IsEmptySearch  是否是空搜索,如果是空搜索查缓存数据
 func (kws *KeyWordsSearch) IsEmptySearch(in *bxcore.SearchReq) bool {
 func (kws *KeyWordsSearch) IsEmptySearch(in *bxcore.SearchReq) bool {
 	//有主关键词 或 选择了行业,都不是空搜索
 	//有主关键词 或 选择了行业,都不是空搜索
-	if in.KeyWords != "" || in.Industry != "" {
+	if in.KeyWords != "" || in.Industry != "" || in.AdditionalWords != "" {
 		return false
 		return false
 	}
 	}
 	return true
 	return true

+ 2 - 2
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -48,7 +48,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 	//初始化搜索对象
 	//初始化搜索对象
 	ks := entity.NewKeyWordsSearch()
 	ks := entity.NewKeyWordsSearch()
 	//处理搜索条件
 	//处理搜索条件
-	heightWods := ks.SearchParamsHandle(in)
+	heightWords := ks.SearchParamsHandle(in)
 	//判断是否是空搜索,如果是空搜索,查缓存数据
 	//判断是否是空搜索,如果是空搜索,查缓存数据
 	if ks.IsEmptySearch(in) {
 	if ks.IsEmptySearch(in) {
 		res.List, res.Count = ks.GetBidSearchListByCache(in)
 		res.List, res.Count = ks.GetBidSearchListByCache(in)
@@ -93,7 +93,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 			res.Count, res.Total, res.List = ks.GetBidSearchList(in) //util.GetBidSearchData(in)
 			res.Count, res.Total, res.List = ks.GetBidSearchList(in) //util.GetBidSearchData(in)
 			logx.Info("2查询耗时:", time.Since(t2))
 			logx.Info("2查询耗时:", time.Since(t2))
 		}
 		}
-		res.KeyWords = strings.Join(heightWods, " ")
+		res.KeyWords = strings.Join(heightWords, " ")
 		res.InterceptOtherWords = in.InterceptOtherWords
 		res.InterceptOtherWords = in.InterceptOtherWords
 		res.InterceptKeyWords = in.InterceptKeyWords
 		res.InterceptKeyWords = in.InterceptKeyWords
 	}
 	}

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

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