|
@@ -62,8 +62,6 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
ErrMsg: "无权限",
|
|
|
}, nil
|
|
|
}
|
|
|
- //搜索范围
|
|
|
- queryItems := userInfo.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit)
|
|
|
if in.UserType == "fType" {
|
|
|
in.BuyerClass = ""
|
|
|
in.BuyerTel = ""
|
|
@@ -72,7 +70,8 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
in.City = ""
|
|
|
}
|
|
|
in.KeyWords = strings.TrimSpace(in.KeyWords)
|
|
|
- searchLimit := util.IsSearchLimit(strings.Split(in.SelectType, ","))
|
|
|
+ //搜索范围
|
|
|
+ queryItems := userInfo.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit)
|
|
|
in.SelectType = strings.Join(queryItems, ",")
|
|
|
//b_word, s_word := "", ""
|
|
|
res.IsLimit = 1
|
|
@@ -82,6 +81,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
//查询数据
|
|
|
if in.KeyWords != "" || in.Industry != "" {
|
|
|
//查询数据
|
|
|
+ searchLimit := util.IsSearchLimit(strings.Split(in.SelectType, ","))
|
|
|
//全文检索限制
|
|
|
if searchLimit {
|
|
|
res.IsLimit = util.IsLimited(in.UserId, in.UserType != "fType")
|
|
@@ -98,9 +98,25 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
}
|
|
|
//二次搜索- 一次搜索结果少于一页数据;关键词长度大于三;第一,二页请求;搜索范围包括title;四个条件
|
|
|
if len([]rune(in.KeyWords)) > 3 && int(count) < util.SearchPageSize && in.PageNum < 3 && strings.Contains(in.SelectType, "title") {
|
|
|
- if in.KeyWords = util.HttpEs(in.KeyWords, "ik_smart", IC.DB.Es.Addr); in.KeyWords != "" {
|
|
|
+ if iksk := util.HttpEs(in.KeyWords, "ik_smart", IC.DB.Es.Addr); iksk != "" {
|
|
|
+ //log.Println("分词:", iksk) 分词后查询数据量有可能小于不分词查询数据量 -- 原因:未分词前是全文查询 分词后是标题查询;
|
|
|
+ iksk = fmt.Sprintf("%s+%s", in.KeyWords, iksk)
|
|
|
+ var kbool = map[string]bool{}
|
|
|
+ var karr = []string{}
|
|
|
+ for _, v := range strings.Split(iksk, "+") {
|
|
|
+ if kbool[v] {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ karr = append(karr, v)
|
|
|
+ kbool[v] = true
|
|
|
+ }
|
|
|
+ in.KeyWords = strings.Join(karr, "+")
|
|
|
in.SelectType = "title"
|
|
|
- count, list = util.GetBidSearchData(in)
|
|
|
+ _count, _list := util.GetBidSearchData(in)
|
|
|
+ if count < _count {
|
|
|
+ count = _count
|
|
|
+ list = _list
|
|
|
+ }
|
|
|
//最多两页数据
|
|
|
if count > util.SearchPageSize*2 {
|
|
|
count = util.SearchPageSize * 2
|