|
@@ -26,12 +26,12 @@ import (
|
|
var (
|
|
var (
|
|
lock, lockrule, lockclear, locktag, blocktag sync.RWMutex
|
|
lock, lockrule, lockclear, locktag, blocktag sync.RWMutex
|
|
|
|
|
|
- cut = ju.NewCut() //获取正文并清理
|
|
|
|
- ExtLogs map[*TaskInfo][]map[string]interface{} //抽取日志
|
|
|
|
- TaskList map[string]*ExtractTask //任务列表
|
|
|
|
- ClearTaskList map[string]*ClearTask //清理任务列表
|
|
|
|
- saveLimit = 100 //抽取日志批量保存
|
|
|
|
- PageSize = 5000 //查询分页
|
|
|
|
|
|
+ cut = ju.NewCut() //获取正文并清理
|
|
|
|
+ ExtLogs map[*TaskInfo][]map[string]interface{} //抽取日志
|
|
|
|
+ TaskList map[string]*ExtractTask //任务列表
|
|
|
|
+ ClearTaskList map[string]*ClearTask //清理任务列表
|
|
|
|
+ saveLimit = 100 //抽取日志批量保存
|
|
|
|
+ PageSize = 5000 //查询分页
|
|
Fields = `{"title":1,"summary":1,"detail":1,"contenthtml":1,"site":1,"spidercode":1,"toptype":1,"subtype":1,"area":1,"city":1,"comeintime":1,"publishtime":1,"sensitive":1,"projectinfo":1,"jsondata":1}`
|
|
Fields = `{"title":1,"summary":1,"detail":1,"contenthtml":1,"site":1,"spidercode":1,"toptype":1,"subtype":1,"area":1,"city":1,"comeintime":1,"publishtime":1,"sensitive":1,"projectinfo":1,"jsondata":1}`
|
|
Fields2 = `{"budget":1,"bidamount":1,"title":1,"projectname":1,"winner":1}`
|
|
Fields2 = `{"budget":1,"bidamount":1,"title":1,"projectname":1,"winner":1}`
|
|
)
|
|
)
|
|
@@ -290,11 +290,12 @@ func (e *ExtractTask) PreInfo(doc map[string]interface{}) (j, jf *ju.Job, isSite
|
|
subtype = "all"
|
|
subtype = "all"
|
|
}
|
|
}
|
|
toMap := qu.ObjToMap(doc["jsondata"])
|
|
toMap := qu.ObjToMap(doc["jsondata"])
|
|
- if toMap != nil {
|
|
|
|
- if (*toMap)["extweight"] == nil {
|
|
|
|
- (*toMap)["extweight"] = ju.Config["jsondata_extweight"]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // log.Debug("toMap", toMap)
|
|
|
|
+ // if toMap != nil {
|
|
|
|
+ // if (*toMap)["extweight"] == nil {
|
|
|
|
+ // (*toMap)["extweight"] = ju.Config["jsondata_extweight"]
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
j = &ju.Job{
|
|
j = &ju.Job{
|
|
SourceMid: qu.BsonIdToSId(doc["_id"]),
|
|
SourceMid: qu.BsonIdToSId(doc["_id"]),
|
|
Category: toptype,
|
|
Category: toptype,
|
|
@@ -1104,6 +1105,7 @@ func extractFromKv(field, fieldname string, blocks []*ju.Block, vc *RuleCore, kv
|
|
"blocktag": bl.Classify,
|
|
"blocktag": bl.Classify,
|
|
"weight": vv.Weight,
|
|
"weight": vv.Weight,
|
|
})
|
|
})
|
|
|
|
+ break //暂定取第一个
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1870,7 +1872,7 @@ func (e *ExtractTask) QualityAudit(resulttmp map[string]interface{}) {
|
|
func (e *ExtractTask) RedisMatch(field, fv string, val map[string]interface{}) {
|
|
func (e *ExtractTask) RedisMatch(field, fv string, val map[string]interface{}) {
|
|
defer qu.Catch()
|
|
defer qu.Catch()
|
|
i := redis.GetInt(field, field+"_"+fv) //查找redis
|
|
i := redis.GetInt(field, field+"_"+fv) //查找redis
|
|
- if i == 0 { //reids未找到,执行规则匹配
|
|
|
|
|
|
+ if i == 0 { //reids未找到,执行规则匹配
|
|
val[field+"_isredis"] = false
|
|
val[field+"_isredis"] = false
|
|
e.RuleMatch(field, fv, val) //规则匹配
|
|
e.RuleMatch(field, fv, val) //规则匹配
|
|
} else { //redis找到,打标识存库
|
|
} else { //redis找到,打标识存库
|