|
@@ -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
|
|
|
}
|