浏览代码

supervisorrate字段临时处理

maxiaoshan 5 年之前
父节点
当前提交
b6a47c1bb6
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 6 1
      udpcreateindex/src/biddingindex.go
  2. 2 2
      udpcreateindex/src/main.go

+ 6 - 1
udpcreateindex/src/biddingindex.go

@@ -124,7 +124,7 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
 		}
 		//下面可以多线程跑的--->
 		//处理分类
-		if compare != nil {
+		if compare != nil { //extract
 			subscopeclass, _ := compare["subscopeclass"].([]interface{})
 			if subscopeclass != nil {
 				//str := ","
@@ -179,6 +179,11 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
 		for tk, tv := range update {
 			tmp[tk] = tv
 		}
+		if tmp["supervisorrate"] != nil { //临时处理supervisorrate抽取类型为string不生索引
+			if _, ok := tmp["supervisorrate"].(string); ok { //supervisorrate数据为string类型
+				delete(tmp, "supervisorrate")
+			}
+		}
 		//对projectscope字段的索引处理
 		ps, _ := tmp["projectscope"].(string)
 		//		if ps == "" {

+ 2 - 2
udpcreateindex/src/main.go

@@ -42,7 +42,7 @@ func init() {
 	project, _ = Sysconfig["project"].(map[string]interface{})
 	project2, _ = Sysconfig["project2"].(map[string]interface{})
 	mconf, _ := Sysconfig["mongodb"].(map[string]interface{})
-	mgo = &mongodb.MongodbSim{
+	mgo = &mongodb.MongodbSim{ //mongodb为binding连接
 		MongodbAddr: mconf["addr"].(string),
 		Size:        util.IntAllDef(mconf["pool"], 5),
 		DbName:      mconf["db"].(string),
@@ -58,7 +58,7 @@ func init() {
 	if savedb == nil {
 		log.Println("未设置保存数据库,默认使用招标库")
 		extractmgo = mgo
-	} else {
+	} else { //savedb为抽取连接
 		addr, _ := savedb["addr"].(string)
 		size := util.IntAllDef(savedb["size"], 5)
 		db, _ := savedb["db"].(string)