Browse Source

fix:数据导出分词校验空处理

duxin 3 years ago
parent
commit
bcf5b2c949
1 changed files with 11 additions and 10 deletions
  1. 11 10
      src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

+ 11 - 10
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -371,17 +371,18 @@ func GetDataExportSearchCountBySieveCondition(scd *SieveCondition, elasticAddres
 					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 secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+						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