|
@@ -149,29 +149,30 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
|
|
}
|
|
}
|
|
//行业
|
|
//行业
|
|
if in.Industry != "" && isLogin {
|
|
if in.Industry != "" && isLogin {
|
|
- var (
|
|
|
|
- topSC []string
|
|
|
|
- topQT bool
|
|
|
|
- )
|
|
|
|
- for _, sv := range strings.Split(in.Industry, ",") {
|
|
|
|
- if strings.Contains(sv, "其他") {
|
|
|
|
- if len(strings.Split(sv, "_")) > 1 {
|
|
|
|
- topSC = append(topSC, strings.Split(sv, "_")[0])
|
|
|
|
- } else {
|
|
|
|
- topQT = true
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //一级行业-其他
|
|
|
|
- if topQT {
|
|
|
|
- mustNot = append(mustNot, `{"exists": {"field": "s_topscopeclass"}}`)
|
|
|
|
- }
|
|
|
|
- if len(topSC) > 0 {
|
|
|
|
- //二级行业-其他
|
|
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustScopeClass, `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`, `"`+strings.Join(topSC, `","`)+`"`))
|
|
|
|
- } else {
|
|
|
|
- musts = append(musts, fmt.Sprintf(queryBoolMustA, "s_subscopeclass", `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`))
|
|
|
|
- }
|
|
|
|
|
|
+ musts = append(musts, fmt.Sprintf(queryBoolMustA, "s_subscopeclass", `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`))
|
|
|
|
+ //var (
|
|
|
|
+ // topSC []string
|
|
|
|
+ // topQT bool
|
|
|
|
+ //)
|
|
|
|
+ //for _, sv := range strings.Split(in.Industry, ",") {
|
|
|
|
+ // if strings.Contains(sv, "其他") {
|
|
|
|
+ // if len(strings.Split(sv, "_")) > 1 {
|
|
|
|
+ // topSC = append(topSC, strings.Split(sv, "_")[0])
|
|
|
|
+ // } else {
|
|
|
|
+ // topQT = true
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ ////一级行业-其他
|
|
|
|
+ //if topQT {
|
|
|
|
+ // mustNot = append(mustNot, `{"exists": {"field": "s_topscopeclass"}}`)
|
|
|
|
+ //}
|
|
|
|
+ //if len(topSC) > 0 {
|
|
|
|
+ // //二级行业-其他
|
|
|
|
+ // musts = append(musts, fmt.Sprintf(queryBoolMustScopeClass, `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`, `"`+strings.Join(topSC, `","`)+`"`))
|
|
|
|
+ //} else {
|
|
|
|
+ // musts = append(musts, fmt.Sprintf(queryBoolMustA, "s_subscopeclass", `"`+strings.ReplaceAll(in.Industry, ",", `","`)+`"`))
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
//价格
|
|
//价格
|
|
if in.Price != "" && len(strings.Split(in.Price, "-")) > 1 {
|
|
if in.Price != "" && len(strings.Split(in.Price, "-")) > 1 {
|