소스 검색

Merge branch 'dev3.4' of http://192.168.3.207:10080/qmx/jy-data-extract into dev3.4

apple 5 년 전
부모
커밋
d53aa820c8
3개의 변경된 파일18개의 추가작업 그리고 17개의 파일을 삭제
  1. 5 4
      udpcreateindex/src/biddingall.go
  2. 1 5
      udpcreateindex/src/biddingindex.go
  3. 12 8
      udpcreateindex/src/projectindex.go

+ 5 - 4
udpcreateindex/src/biddingall.go

@@ -84,10 +84,11 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 		// 	tmp = make(map[string]interface{})
 		// 	continue
 		// }
-		if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive != "" { //bidding中有敏感词,不生索引
-			tmp = make(map[string]interface{})
-			continue
-		}
+
+		// if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive != "" { //bidding中有敏感词,不生索引
+		// 	tmp = make(map[string]interface{})
+		// 	continue
+		// }
 		update := map[string]interface{}{}
 		del := map[string]interface{}{} //记录extract没有值而bidding中有值的字段
 		//对比方法----------------

+ 1 - 5
udpcreateindex/src/biddingindex.go

@@ -138,14 +138,10 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
 	log.Println("开始迭代..")
 	for n, tmp := range infos {
 		n1++
-		// if qutil.IntAll(tmp["dataging"]) == 1 { //dataging=1不生索引
+		// if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive != "" { //bidding中有敏感词,不生索引
 		// 	tmp = make(map[string]interface{})
 		// 	continue
 		// }
-		if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive != "" { //bidding中有敏感词,不生索引
-			tmp = make(map[string]interface{})
-			continue
-		}
 		update := map[string]interface{}{} //要更新的mongo数据
 		//对比方法----------------
 		tid := qutil.BsonIdToSId(tmp["_id"])

+ 12 - 8
udpcreateindex/src/projectindex.go

@@ -23,17 +23,21 @@ func projectTask(data []byte, project, mapInfo map[string]interface{}) {
 				"$lte": util.StringTOBsonId(mapInfo["lteid"].(string)),
 			},
 		}
-	}
-	idMap, _ := q["_id"].(map[string]interface{})
-	if idMap != nil {
-		tmpQ := map[string]interface{}{}
-		for c, id := range idMap {
-			if idStr, ok := id.(string); ok && id != "" {
-				tmpQ[c] = util.StringTOBsonId(idStr)
+	} else {
+		if q["pici"] == nil {
+			idMap, _ := q["_id"].(map[string]interface{})
+			if idMap != nil {
+				tmpQ := map[string]interface{}{}
+				for c, id := range idMap {
+					if idStr, ok := id.(string); ok && id != "" {
+						tmpQ[c] = util.StringTOBsonId(idStr)
+					}
+				}
+				q["_id"] = tmpQ
 			}
 		}
-		q["_id"] = tmpQ
 	}
+
 	var session *mgov.Session
 	if project["addr"] != nil {
 		session = project2db.GetMgoConn(3600)