|
@@ -548,15 +548,16 @@ func GetDataExportIds(elasticAddress string, scd *SieveCondition, checkCount int
|
|
|
}
|
|
|
if searchTextSize > 3 && num < 50 {
|
|
|
if strings.Index(scd.SelectType, "title") > -1 {
|
|
|
- secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress)
|
|
|
- scd.Keyword[0].Keyword = secondKWS
|
|
|
- scd.SelectType = "title"
|
|
|
- qstr = getDataExportSql(scd)
|
|
|
- log.Printf("GetDataExportIds-%s-分词查询-sql:%s\n", scd.Id, qstr)
|
|
|
- res2 := doSearch(qstr, 0, 100, "")
|
|
|
- res = *delRepeatMapArr(&res, res2)
|
|
|
- if len(res) > 100 {
|
|
|
- res = res[:100]
|
|
|
+ if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
|
|
|
+ scd.Keyword[0].Keyword = secondKWS
|
|
|
+ scd.SelectType = "title"
|
|
|
+ qstr = getDataExportSql(scd)
|
|
|
+ log.Printf("GetDataExportIds-%s-分词查询-sql:%s\n", scd.Id, qstr)
|
|
|
+ res2 := doSearch(qstr, 0, 100, "")
|
|
|
+ res = *delRepeatMapArr(&res, res2)
|
|
|
+ if len(res) > 100 {
|
|
|
+ res = res[:100]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -602,15 +603,16 @@ func GetDataExportSearchResult(bid mg.MongodbSim, bidMgoDBName, elasticAddress s
|
|
|
}
|
|
|
if searchTextSize > 3 && num < 50 {
|
|
|
if strings.Index(scd.SelectType, "title") > -1 {
|
|
|
- secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress)
|
|
|
- scd.Keyword[0].Keyword = secondKWS
|
|
|
- scd.SelectType = "title"
|
|
|
- qstr = getDataExportSql(scd)
|
|
|
- log.Printf("GetDataExportSearchResult-%s-分词查询-sql:%s\n", scd.Id, qstr)
|
|
|
- res2 := doSearch(qstr, 0, 100, "")
|
|
|
- res = *delRepeatMapArr(&res, res2)
|
|
|
- if len(res) > 100 {
|
|
|
- res = res[:100]
|
|
|
+ if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
|
|
|
+ scd.Keyword[0].Keyword = secondKWS
|
|
|
+ scd.SelectType = "title"
|
|
|
+ qstr = getDataExportSql(scd)
|
|
|
+ log.Printf("GetDataExportSearchResult-%s-分词查询-sql:%s\n", scd.Id, qstr)
|
|
|
+ res2 := doSearch(qstr, 0, 100, "")
|
|
|
+ res = *delRepeatMapArr(&res, res2)
|
|
|
+ if len(res) > 100 {
|
|
|
+ res = res[:100]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|