|
@@ -174,11 +174,15 @@ func dealTopInformation(where interface{}, timeType int) {
|
|
|
topinformation = removeDuplicates(topinformation) //去重
|
|
|
//ToDo 1.更新MongoDB
|
|
|
biddingID := mongodb.BsonIdToSId(tmp["_id"])
|
|
|
- updateData := map[string]interface{}{
|
|
|
+ updateMgo := map[string]interface{}{
|
|
|
+ "tag_topinformation": topinformation,
|
|
|
+ "topinformation_time": time.Now().Unix(),
|
|
|
+ }
|
|
|
+ updateEs := map[string]interface{}{
|
|
|
"tag_topinformation": topinformation,
|
|
|
}
|
|
|
//log.Println("hasNew", " ====== ", biddingID)
|
|
|
- Mgo.UpdateById("bidding", biddingID, map[string]interface{}{"$set": updateData})
|
|
|
+ Mgo.UpdateById("bidding", biddingID, map[string]interface{}{"$set": updateMgo})
|
|
|
//ToDo 2.更新es
|
|
|
// 存量数据
|
|
|
if timeType == timeTypeAll {
|
|
@@ -192,11 +196,11 @@ func dealTopInformation(where interface{}, timeType int) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- err := Esa.UpdateDocument("bidding", biddingID, updateData)
|
|
|
+ err := Esa.UpdateDocument("bidding", biddingID, updateEs)
|
|
|
if err != nil && err.Error() != "Document not updated: noop" {
|
|
|
log.Println("esa update err", biddingID, err)
|
|
|
}
|
|
|
- err = Esb.UpdateDocument("bidding", biddingID, updateData)
|
|
|
+ err = Esb.UpdateDocument("bidding", biddingID, updateEs)
|
|
|
if err != nil && err.Error() != "Document not updated: noop" {
|
|
|
log.Println("esb update err", biddingID, err)
|
|
|
}
|