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

Merge branch 'dev4.5.2' of http://127.0.0.1:8080/qmx/jy into dev4.5.2

zhangyuhan 4 жил өмнө
parent
commit
facb3b0ace

+ 16 - 14
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -333,21 +333,23 @@ func GetDataExportSearchCountBySieveCondition(scd *SieveCondition, elasticAddres
 				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, "")
-				}
-				secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress)
-				scd.Keyword[0].Keyword = secondKWS
-				scd.SelectType = "title"
-				qstr = getDataExportSql(scd)
-				res2 := doSearch(qstr, 0, 100, "")
-				result := len(*delRepeatMapArr(res, res2))
-				if result > 100 {
-					result = 100
+				if strings.Index(scd.SelectType, "title") > -1 {
+					var res *[]map[string]interface{}
+					if count > 0 {
+						res = doSearch(qstr, 0, count, "")
+					}
+					secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress)
+					scd.Keyword[0].Keyword = secondKWS
+					scd.SelectType = "title"
+					qstr = getDataExportSql(scd)
+					res2 := doSearch(qstr, 0, 100, "")
+					result := len(*delRepeatMapArr(res, res2))
+					if result > 100 {
+						result = 100
+					}
+					log.Printf("GetDataExportSearchCountUseId-%s-count:%d-分词-sql:%s\n", scd.Id, result, qstr)
+					return result
 				}
-				log.Printf("GetDataExportSearchCountUseId-%s-count:%d-分词-sql:%s\n", scd.Id, result, qstr)
-				return result
 			}
 			return
 		}