Ver Fonte

fix:增加配置

duxin há 1 ano atrás
pai
commit
3e74c8d1e6

+ 1 - 0
jyBXCore/rpc/etc/bxcore.yaml

@@ -32,6 +32,7 @@ PaySearchLimit:
   WordSize: 7
   PageNum: 1
   PageSize: 20
+  PrecisionNum: 50
 KeywordsLimit: 35 #主搜索框 关键词长度限制
 DefaultBidInfo: #默认搜索
   PageNum: 10 #总页数

+ 7 - 6
jyBXCore/rpc/internal/config/config.go

@@ -28,12 +28,13 @@ type Config struct {
 	SearchTypeSwitch bool //标题和正文 同时查询,关键词>1;是否优化查询只查正文(正文包含标题)
 	FileSignBool     bool //IC.C.FileSignBool列表是否显示附件标识开关
 	PaySearchLimit   struct {
-		Switch   bool
-		Year     int
-		Month    int
-		WordSize int
-		PageNum  int64
-		PageSize int64
+		Switch       bool
+		Year         int
+		Month        int
+		WordSize     int
+		PageNum      int64
+		PageSize     int64
+		PrecisionNum int64
 	} //优化付费用户搜索速度
 	KeywordsLimit  int //关键词长度限制
 	DefaultBidInfo struct {

+ 6 - 7
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -165,15 +165,14 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 			t2 := time.Now()
 			in.PublishTime = publishTime
 			res.Count, res.Total, res.List = ks.GetBidSearchList(in)
-			// 精准模式不足50条的非空标讯查询 匹配模糊查询数
-			if res.Count < 50 && in.SearchMode == 0 && in.KeyWords != "" {
-				ks.SearchParamsHandle(nin)
-				res.BCount = service.GetBidSearchCount(nin)
-				log.Println("精准查询数据不足 匹配模糊查询数:", res.BCount)
-			}
-
 			log.Println("2查询耗时:", time.Since(t2))
 		}
+		// 精准模式不足50条的非空标讯查询 匹配模糊查询数
+		if res.Count < IC.C.PaySearchLimit.PrecisionNum && in.SearchMode == 0 && in.KeyWords != "" {
+			ks.SearchParamsHandle(nin)
+			res.BCount = service.GetBidSearchCount(nin)
+			log.Println("精准查询数据不足 匹配模糊查询数:", res.BCount)
+		}
 		res.KeyWords = strings.Join(heightWords, " ")
 		res.InterceptOtherWords = in.InterceptOtherWords
 		res.InterceptKeyWords = in.InterceptKeyWords