Эх сурвалжийг харах

数据导出非关键词查询

wangshan 5 жил өмнө
parent
commit
f1cf45cf47
1 өөрчлөгдсөн 17 нэмэгдсэн , 20 устгасан
  1. 17 20
      src/jfw/public/search.go

+ 17 - 20
src/jfw/public/search.go

@@ -271,31 +271,28 @@ func GetDataExportSearchCountUseId(_id string) (count int) {
 	}
 	count = int(elastic.Count(INDEX, TYPE, qstr))
 	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
-	if scd.Comeinfrom == "supersearchPage" || scd.Comeinfrom == "exportPage" {
-		if len(scd.Keyword) != 0 || len(scd.Industry) != 0 {
-
-			searchTextSize := 0
-			if len(scd.Keyword) > 0 {
-				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+	//if scd.Comeinfrom == "supersearchPage" || scd.Comeinfrom == "exportPage" {
+	if len(scd.Keyword) != 0 {
+		searchTextSize := 0
+		if len(scd.Keyword) > 0 {
+			searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+		}
+		if searchTextSize > 3 && count < 50 {
+			var res *[]map[string]interface{}
+			if count > 0 {
+				res = doSearch(qstr, 0, count, "")
 			}
-			if searchTextSize > 3 && count < 50 {
-				var res *[]map[string]interface{}
-				if count > 0 {
-					res = doSearch(qstr, 0, count, "")
-				}
-				secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", config.Sysconfig["elasticsearch"].(string))
-				scd.Keyword[0].Keyword = secondKWS
+			secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", config.Sysconfig["elasticsearch"].(string))
+			scd.Keyword[0].Keyword = secondKWS
 
-				qstr = getDataExportSql(scd)
-				res2 := doSearch(qstr, 0, 100-count, "")
+			qstr = getDataExportSql(scd)
+			res2 := doSearch(qstr, 0, 100-count, "")
 
-				return len(*delRepeatMapArr(res, res2))
-			}
-			return
-		} else {
-			return ExConf.MsgMaxCount
+			return len(*delRepeatMapArr(res, res2))
 		}
+		return
 	}
+	//}
 	return
 }