Selaa lähdekoodia

搜索数量修改

WH01243 2 vuotta sitten
vanhempi
commit
0cf22d7d10
2 muutettua tiedostoa jossa 7 lisäystä ja 8 poistoa
  1. 5 6
      jyBXCore/rpc/entity/search.go
  2. 2 2
      jyBXCore/rpc/service/search.go

+ 5 - 6
jyBXCore/rpc/entity/search.go

@@ -279,7 +279,7 @@ func (kws *KeyWordsSearch) GetBidSearchList(in *bxcore.SearchReq) (count, total
 // 聚合搜索
 func (kws *KeyWordsSearch) PolymerizeSearch(in *bxcore.PolymerizeSearchReq) *bxcore.SearchReturn {
 	data := &bxcore.SearchReturn{}
-	powerCheck := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	//powerCheck := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
 	//企业搜索
 	now1 := time.Now().Unix()
 	entList := &bxcore.SearchMap{}
@@ -297,13 +297,12 @@ func (kws *KeyWordsSearch) PolymerizeSearch(in *bxcore.PolymerizeSearchReq) *bxc
 		//菜单搜索
 		data.MenuList = service.MenuSearch(in)
 		//标讯搜索
+		/*	now4 := time.Now().Unix()
+			subscribeList := &bxcore.SearchMap{}
+			subscribeList.Data = service.SubscribeSearch(in.SearchCode, powerCheck)
+			data.SubscribeList = subscribeList*/
 		now4 := time.Now().Unix()
-		subscribeList := &bxcore.SearchMap{}
-		subscribeList.Data = service.SubscribeSearch(in.SearchCode, powerCheck)
-		data.SubscribeList = subscribeList
-		now5 := time.Now().Unix()
 		log.Println("菜单搜索", now4-now3)
-		log.Println("标讯搜索", now5-now4)
 	}
 	return data
 }

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

@@ -76,7 +76,7 @@ func EntSearch(searchCode string) ([]*bxcore.Search, int64) {
 	thisQuery = append(thisQuery, fmt.Sprintf(`{"match_phrase":{"name":"%s"}}`, searchCode))
 	musts = append(musts, fmt.Sprintf(`{"bool":{"should":[%s],"minimum_should_match": 1}}`, strings.Join(thisQuery, ",")))
 	sql := fmt.Sprintf(entQuery, strings.Join(musts, ","), "")
-	sql = sql[:len(sql)-1] + fmt.Sprintf(`,"from":%d,"size":%d}`, 0, 10)
+	sql = sql[:len(sql)-1] + fmt.Sprintf(`,"from":%d,"size":%d}`, 0, 5)
 	log.Println("企业搜索sql:", sql)
 	count, list := elastic.GetWithCount(index, itype, "", sql)
 	if list != nil {
@@ -94,7 +94,7 @@ func ProcureSearch(searchCode string) ([]*bxcore.Search, int64) {
 	count := int64(0)
 	//数据查询处理
 	entNameQuery := fmt.Sprintf(`{"multi_match": {"query": "%s","type": "phrase", "fields": ["name"]}}`, searchCode)
-	qstr := fmt.Sprintf(query, fmt.Sprintf(`"from":%d,"size": %d,`, 0, 10), entNameQuery)
+	qstr := fmt.Sprintf(query, fmt.Sprintf(`"from":%d,"size": %d,`, 0, 5), entNameQuery)
 	log.Println("采购单位搜索sql:", qstr)
 	count, rs := elastic.GetWithCount(BuyerIndex, BuyerType, "", qstr)
 	//rs := elastic.Get(BuyerIndex, BuyerType, qstr) // 采购单位列表