|
@@ -78,31 +78,27 @@ func biddingTask(mapInfo map[string]interface{}) {
|
|
|
<-ch
|
|
|
wg.Done()
|
|
|
}()
|
|
|
- //判断是否是预处理数据;pre_id 是标识
|
|
|
- //if config.Conf.Env.OpenPre {
|
|
|
- // if pre_id, ok := tmp["pre_id"]; ok {
|
|
|
- // preID := util.ObjToString(pre_id)
|
|
|
- // if preID != "" {
|
|
|
- // deletePreEsData(preID)
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
+
|
|
|
if sensitive := util.ObjToString(tmp["sensitive"]); sensitive == "测试" { //bidding中有敏感词,不生索引
|
|
|
tmp = make(map[string]interface{})
|
|
|
return
|
|
|
}
|
|
|
//只针对增量数据处理;全量数据 需要用extracttype字段判断
|
|
|
//7: 重复数据
|
|
|
- //8: 不重复
|
|
|
- if util.IntAll(tmp["dataprocess"]) != 8 {
|
|
|
- return
|
|
|
- }
|
|
|
+ //8: 不重
|
|
|
+ //if util.IntAll(tmp["dataprocess"]) != 8 {
|
|
|
+ // return
|
|
|
+ //}
|
|
|
//// 增量数据使用上面判断;全量数据使用下面配置
|
|
|
//-1:重复 ,1:不重复 ,0:入库 9:分类
|
|
|
//if util.IntAll(tmp["extracttype"]) != 1 {
|
|
|
// return
|
|
|
//}
|
|
|
|
|
|
+ // 优选字段,和 extracttype 一致,isprefer 1:优选 -1:取消优选
|
|
|
+ if util.IntAll(tmp["isprefer"]) != 1 {
|
|
|
+ return
|
|
|
+ }
|
|
|
//针对产权数据,暂时不入es 索引库
|
|
|
if util.IntAll(tmp["infoformat"]) == 3 {
|
|
|
return
|
|
@@ -126,7 +122,8 @@ func biddingTask(mapInfo map[string]interface{}) {
|
|
|
index++
|
|
|
indexLock.Unlock()
|
|
|
newTmp, update := GetEsField(tmp, stype)
|
|
|
- newTmp["dataweight"] = 0 //索引数据新增 jy置顶字段
|
|
|
+ newTmp["dataweight"] = 0 //索引数据新增 jy置顶字段
|
|
|
+ newTmp["old_preferid"] = tmp["old_preferid"] //上次优选ID,需要es 删除
|
|
|
|
|
|
//针对中国政府采购网,单独处理
|
|
|
if util.ObjToString(tmp["site"]) == "中国政府采购网" {
|
|
@@ -137,8 +134,14 @@ func biddingTask(mapInfo map[string]interface{}) {
|
|
|
}
|
|
|
//
|
|
|
if stype == "bidding" || stype == "bidding_history" || stype == "index-by-id" {
|
|
|
- newTmp["pici"] = time.Now().Unix()
|
|
|
- update["pici"] = time.Now().Unix()
|
|
|
+ //之前存在pici,就不在添加
|
|
|
+ if pici, ok := tmp["pici"]; ok {
|
|
|
+ newTmp["pici"] = pici
|
|
|
+ } else {
|
|
|
+ newTmp["pici"] = time.Now().Unix()
|
|
|
+ update["pici"] = time.Now().Unix()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
//todo 处理中国移动定制标签
|
|
|
if len(globalRegs) > 0 && len(MatchArr) > 0 {
|
|
@@ -264,6 +267,11 @@ func biddingAllTask(mapInfo map[string]interface{}) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 优选字段,和 extracttype 一致,isprefer 1:优选 -1:取消优选
|
|
|
+ if util.IntAll(tmp["isprefer"]) != 1 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//针对产权数据,暂时不入es 索引库
|
|
|
if util.IntAll(tmp["infoformat"]) == 3 {
|
|
|
return
|
|
@@ -280,6 +288,7 @@ func biddingAllTask(mapInfo map[string]interface{}) {
|
|
|
index++
|
|
|
indexLock.Unlock()
|
|
|
newTmp, update := GetEsField(tmp, stype)
|
|
|
+ newTmp["old_preferid"] = tmp["old_preferid"] //上次优选ID,需要es 删除
|
|
|
//针对中国政府采购网,单独处理
|
|
|
if util.ObjToString(tmp["site"]) == "中国政府采购网" {
|
|
|
objectType := MatchService(tmp)
|
|
@@ -449,7 +458,8 @@ func biddingTaskById(mapInfo map[string]interface{}) {
|
|
|
|
|
|
if util.IntAll((*tmp)["extracttype"]) == 1 {
|
|
|
newTmp, update := GetEsField(*tmp, stype)
|
|
|
- newTmp["dataweight"] = 0 //索引数据新增 jy置顶字段
|
|
|
+ newTmp["dataweight"] = 0 //索引数据新增 jy置顶字段
|
|
|
+ newTmp["old_preferid"] = (*tmp)["old_preferid"] //上次优选ID,需要es 删除
|
|
|
if len(update) > 0 {
|
|
|
//updateBiddingPool <- []map[string]interface{}{{
|
|
|
// "_id": mongodb.StringTOBsonId(infoid),
|