Explorar o código

buyer es新增province和city

maxiaoshan %!s(int64=4) %!d(string=hai) anos
pai
achega
7a27d545a4

+ 5 - 1
udpcreateindex/src/buyertask.go

@@ -10,7 +10,7 @@ import (
 	"gopkg.in/mgo.v2/bson"
 )
 
-var fieldArr = []string{"institute_type", "fixedphone", "mobilephone", "latestfixedphone", "latestmobilephone"}
+var fieldArr = []string{"institute_type", "fixedphone", "mobilephone", "latestfixedphone", "latestmobilephone", "province", "city"}
 
 func buyerEsTaskOnce() {
 	defer qu.Catch()
@@ -25,6 +25,8 @@ func buyerEsTaskOnce() {
 	task_sid := qu.BsonIdToSId(bson.NewObjectIdWithTime(preTime))
 	task_eid := qu.BsonIdToSId(bson.NewObjectIdWithTime(curTime))
 	log.Println("buyer 区间id:", task_sid, task_eid)
+	// task_sid = "5e6611b7aec95406dccf714e"
+	// task_eid = "5f7249164bdc0447a6c90fa5"
 	//区间id
 	q := map[string]interface{}{
 		"_id": map[string]interface{}{
@@ -51,6 +53,8 @@ func buyerEsTaskOnce() {
 		"mobilephone":       1,
 		"latestfixedphone":  1,
 		"latestmobilephone": 1,
+		"province":          1,
+		"city":              1,
 	}).Sort("_id").Iter()
 	num_1 := 0
 	for tmp := make(map[string]interface{}); it_1.Next(&tmp); num_1++ {

+ 3 - 1
udpcreateindex/src/config.json

@@ -79,7 +79,7 @@
     },
     "standard": {
  		"addr": "192.168.3.207:27092",
-        "size": 10,
+        "pool": 10,
         "db": "mxs",
     	"winnerent":{
 			"collect1": "winner_enterprise",
@@ -101,6 +101,8 @@
     },
     "elastic": {
         "addr": "http://192.168.3.11:9800",
+        "index": "bidding",
+        "itype": "bidding",
         "pool": 12
     }
 }

+ 1 - 0
udpcreateindex/src/main.go

@@ -100,6 +100,7 @@ func init() {
 	}
 	mgostandard = &mongodb.MongodbSim{
 		MongodbAddr: standard["addr"].(string),
+		ReplSet:     "bidding",
 		Size:        util.IntAllDef(standard["pool"], 5),
 		DbName:      standard["db"].(string),
 	}