Sfoglia il codice sorgente

wip:行业分类其他筛选

wangshan 1 anno fa
parent
commit
4c3242547e
1 ha cambiato i file con 24 aggiunte e 23 eliminazioni
  1. 24 23
      jyBXCore/rpc/model/es/search.go

+ 24 - 23
jyBXCore/rpc/model/es/search.go

@@ -149,29 +149,30 @@ func GetSearchQuery(in *bxcore.SearchReq, mustQuery string) (qstr string) {
 	}
 	//行业
 	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 {