|
@@ -216,6 +216,10 @@ func site_attach_text(q map[string]interface{}) {
|
|
|
i := 0
|
|
|
for tmp := make(map[string]interface{}); query.Next(tmp); i = i + 1 {
|
|
|
n++
|
|
|
+ //计数
|
|
|
+ if n%savesizei == 0 {
|
|
|
+ log.Println("当前:", n)
|
|
|
+ }
|
|
|
site, _ := tmp["site"].(string)
|
|
|
if util.IntAll(tmp["extracttype"]) == -1 || site != "中国招标投标公共服务平台" || tmp["attach_text"] == nil {
|
|
|
tmp = make(map[string]interface{})
|
|
@@ -224,9 +228,8 @@ func site_attach_text(q map[string]interface{}) {
|
|
|
newTmp := map[string]interface{}{} //最终生索引的数据
|
|
|
saveArr := []map[string]interface{}{}
|
|
|
|
|
|
- filetext := getFileText(tmp) //oss拼装filetext
|
|
|
- filetext_afterspace := FilterDetailSpace(filetext) //去除空格
|
|
|
- if len(filetext_afterspace) > 10 {
|
|
|
+ filetext := getFileText(tmp) //oss拼装filetext
|
|
|
+ if len(filetext) > 10 {
|
|
|
tmp["detail"] = filetext //filetext替换detail
|
|
|
saveArr = append(saveArr, map[string]interface{}{"_id": tmp["_id"]})
|
|
|
saveArr = append(saveArr, map[string]interface{}{
|
|
@@ -237,7 +240,7 @@ func site_attach_text(q map[string]interface{}) {
|
|
|
})
|
|
|
newTmp["filetext"] = filetext //
|
|
|
} else {
|
|
|
- log.Println("filetext is null string:", tmp["_id"])
|
|
|
+ //log.Println("filetext is null string:", tmp["_id"])
|
|
|
tmp = make(map[string]interface{})
|
|
|
continue
|
|
|
}
|
|
@@ -323,10 +326,6 @@ func site_attach_text(q map[string]interface{}) {
|
|
|
arrEs = []map[string]interface{}{}
|
|
|
}
|
|
|
SaveUpdageLock.Unlock()
|
|
|
- //计数
|
|
|
- if n%savesizei == 0 {
|
|
|
- log.Println("当前:", n)
|
|
|
- }
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
|