Explorar el Código

Merge branch 'feature/v1.1' of http://192.168.3.207:8080/BaseService/jyMicroservices into feature/v1.1

123456 hace 3 años
padre
commit
fa7fa4a28a
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. 3 2
      jyBXBase/rpc/model/newestBidding.go
  2. 2 2
      jyBXCore/rpc/util/search.go

+ 3 - 2
jyBXBase/rpc/model/newestBidding.go

@@ -22,7 +22,7 @@ const (
 	multi_match         = `{"multi_match": {"query": %s,"type": "phrase", "fields": ["title"]}}`
 	query_bool_must     = `{"terms":{"%s":[%s]}}`
 	query_bool_must_and = `{"bool":{"must":[%s],"must_not":[%s]}}`
-	search_field        = `"_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner","filetext","spidercode","site"`
+	search_field        = `"_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner","filetext","isValidFile",spidercode","site"`
 	query_city_hkeys    = `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": 1}},"highlight": {"pre_tags": ["<a>"],"post_tags": ["</a>"],"fields": {"title": {"fragment_size": 0,"number_of_fragments": 1}}},"_source":[` + search_field + `],"sort":[{"publishtime":"desc"},{"budget":"desc"}],"from":0,"size":20}`
 )
 
@@ -179,6 +179,7 @@ func NewestES(doSearchStr string) (res []*bxbase.NewestList) {
 	if list != nil && len(*list) > 0 {
 		for _, v := range *list {
 			_id := mongodb.BsonIdToSId(v["_id"])
+			isValidFile, _ := v["isValidFile"].(bool)
 			res = append(res, &bxbase.NewestList{
 				Id:          ME.EncodeArticleId2ByCheck(_id),
 				Title:       MC.ObjToString(v["title"]),
@@ -189,7 +190,7 @@ func NewestES(doSearchStr string) (res []*bxbase.NewestList) {
 				Industry:    MC.If(MC.ObjToString(v["s_subscopeclass"]) != "", strings.Split(strings.Split(MC.ObjToString(v["s_subscopeclass"]), ",")[0], "_")[0], "").(string),
 				Budget:      MC.Int64All(v["budget"]),
 				Bidamount:   MC.Int64All(v["bidamount"]),
-				FileExists:  v["filetext"] != nil,
+				FileExists:  isValidFile, //附件
 				PublishTime: MC.Int64All(v["publishtime"]),
 				Site:        MC.ObjToString(v["site"]),
 				SpiderCode:  MC.ObjToString(v["spidercode"]),

+ 2 - 2
jyBXCore/rpc/util/search.go

@@ -159,7 +159,7 @@ const (
 
 	bidSearch_field_1    = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site"` //,"filetext"
 	bidSearch_field      = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
-	bidSearch_field_file = `,"filetext"`
+	bidSearch_field_file = `,"filetext","isValidFile"`
 	query_bool_should    = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 )
 
@@ -579,7 +579,7 @@ func searchListFormart(repl *[]map[string]interface{}, b bool) (list []*bxcore.S
 		searchList.AreaUrl = IC.LabelMap[searchList.Area].Url
 		searchList.BuyerClass = MC.ObjToString(v["buyerclass"])
 		searchList.City = MC.ObjToString(v["city"])
-		searchList.FileExists = v["filetext"] != nil
+		searchList.FileExists, _ = v["isValidFile"].(bool) //附件
 		searchList.Id = ME.EncodeArticleId2ByCheck(MC.ObjToString(v["id"]))
 		searchList.Industry = MC.ObjToString(v["industry"])
 		searchList.IndustryUrl = IC.LabelMap[searchList.Industry].Url