Jianghan 2 gadi atpakaļ
vecāks
revīzija
e4a279b1f9

+ 17 - 6
createEsIndex/bidding_es.go

@@ -104,6 +104,15 @@ func biddingTask(mapInfo map[string]interface{}) {
 	}
 	wg.Wait()
 	log.Info("biddingTask over", zap.Int("count", c1), zap.Int("index", index))
+
+	// 重采平台需要
+	//mapInfo["stype"] = ""
+	//datas, _ := json.Marshal(mapInfo)
+	//var next = &net.UDPAddr{
+	//	IP:   net.ParseIP("127.0.0.1"),
+	//	Port: 1910,
+	//}
+	//log.Info("bidding index es over", zap.Any("es", next), zap.String("mapinfo", string(datas)))
 }
 
 func biddingAllTask(mapInfo map[string]interface{}) {
@@ -177,15 +186,15 @@ func biddingTaskById(mapInfo map[string]interface{}) {
 	if sensitive := util.ObjToString((*tmp)["sensitive"]); sensitive == "测试" { //bidding中有敏感词,不生索引
 		return
 	}
-	if util.IntAll((*tmp)["dataprocess"]) == 8 {
+	if util.IntAll((*tmp)["extracttype"]) == 1 {
 		newTmp, update := GetEsField(*tmp, stype)
 		newTmp["dataweight"] = 0 //索引数据新增 jy置顶字段
 		if len(update) > 0 {
-			updateBiddingPool <- []map[string]interface{}{{
-				"_id": mongodb.StringTOBsonId(infoid),
-			},
-				{"$set": update},
-			}
+			//updateBiddingPool <- []map[string]interface{}{{
+			//	"_id": mongodb.StringTOBsonId(infoid),
+			//},
+			//	{"$set": update},
+			//}
 		}
 		saveEsPool <- newTmp
 	}
@@ -350,6 +359,8 @@ func GetEsField(tmp map[string]interface{}, stype string) (map[string]interface{
 	YuceEndtime(newTmp) // 预测结果时间
 	if stype == "bidding" || stype == "bidding_history" {
 		newTmp["createtime"] = time.Now().Unix() // es库数据创建时间,只有增量数据有
+		newTmp["pici"] = time.Now().Unix()       //createtime跟pici一样,为了剑鱼功能需要,并行存在一段时间,之后可以删掉createtime
+		update["pici"] = time.Now().Unix()
 	}
 
 	if len(saveErr) > 0 {

+ 11 - 6
createEsIndex/common.toml

@@ -6,7 +6,7 @@ jyport = 11118
 
 [db]
 [db.mongoB]
-addr = "127.0.0.1:27092"
+addr = "192.168.3.207:27092"
 dbname = "wjh"
 coll = "bidding"
 size = 15
@@ -14,7 +14,7 @@ user = ""
 password = ""
 
 [db.mongoP]
-addr = "127.0.0.1:27092"
+addr = "192.168.3.207:27092"
 dbname = "wjh"
 coll = "projectset"
 size = 15
@@ -22,7 +22,7 @@ user = ""
 password = ""
 
 [db.mongoQ]
-addr = "127.0.0.1:27092"
+addr = "192.168.3.207:27092"
 dbname = "mixdata"
 coll = "qyxy_std"
 size = 15
@@ -30,12 +30,12 @@ user = ""
 password = ""
 
 [db.es]
-addr = "http://127.0.0.1:19800"
-addrp = "http://127.0.0.1:19800"
+addr = "http://192.168.3.206:9800"
+addrp = "http://192.168.3.206:9800"
 size = 5
 indexb = "bidding_v1"
 typeb = "bidding"
-indexp = "projectset"
+indexp = "projectset_v2"
 typep = "projectset"
 indexwinner = "winner"
 typewinner = "winner"
@@ -146,6 +146,11 @@ format = "text"
 "multipackage" = "int32"
 "isValidFile" = "bool"
 "bid_field" = "string"
+"bidstarttime" = "int64"
+"docendtime" = "int64"
+"docstarttime" = "int64"
+"signendtime" = "int64"
+"signstarttime" = "int64"
 [db.es.fieldpurchasinglist]
 "itemname" = "string"
 "item" = "string"

+ 2 - 3
createEsIndex/main.go

@@ -66,7 +66,6 @@ func init() {
 }
 
 func main() {
-
 	go checkMapJob()
 	go task_index()
 
@@ -415,7 +414,7 @@ func task() {
 	ch := make(chan bool, 10)
 	wg := &sync.WaitGroup{}
 
-	query := sess.DB("qfw").C("bidding_0922").Find(nil).Iter()
+	query := sess.DB("qfw").C("result_replace_repair_log").Find(nil).Iter()
 	count := 0
 	for tmp := make(map[string]interface{}); query.Next(tmp); count++ {
 		if count%1000 == 0 {
@@ -428,7 +427,7 @@ func task() {
 				<-ch
 				wg.Done()
 			}()
-			if id := util.ObjToString(tmp["infoid"]); mongodb.IsObjectIdHex(id) {
+			if id := util.ObjToString(tmp["replace_id"]); mongodb.IsObjectIdHex(id) {
 				biddingTaskById(map[string]interface{}{"infoid": id, "stype": "bidding"})
 			}
 		}(tmp)

+ 2 - 3
createEsIndex/project_es.go

@@ -52,6 +52,7 @@ func projectTask(data []byte, mapInfo map[string]interface{}) {
 			log.Info("current", zap.Int("count", n))
 		}
 		newTmp := make(map[string]interface{})
+		newTmp["s_projectname"] = tmp["projectname"]
 		for f, ftype := range ProjectField {
 			if tmp[f] != nil {
 				if f == "package" {
@@ -142,10 +143,8 @@ func projectTask(data []byte, mapInfo map[string]interface{}) {
 					} else {
 						newTmp[f] = tmp[f]
 					}
-				} else if f == "s_projectname" {
-					newTmp[f] = tmp["projectname"]
 				} else if f == "ids" || f == "_id" || f == "mpc" || f == "mpn" || f == "review_experts" || f == "winnerorder" ||
-					f == "entidlist" || f == "first_cooperation" {
+					f == "entidlist" || f == "first_cooperation" || f == "subscopeclass" {
 					newTmp[f] = tmp[f]
 				} else {
 					if fieldval := tmp[f]; reflect.TypeOf(fieldval).String() != ftype {