| @@ -186,14 +186,16 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) | |||||
| record["num_watches"] = recordSource["num_watches"] | record["num_watches"] = recordSource["num_watches"] | ||||
| record["num_stars"] = recordSource["num_stars"] | record["num_stars"] = recordSource["num_stars"] | ||||
| record["num_forks"] = recordSource["num_forks"] | record["num_forks"] = recordSource["num_forks"] | ||||
| record["topics"] = recordSource["topics"] | |||||
| if record["topics"] != nil { | if record["topics"] != nil { | ||||
| topicsStr := record["topics"].(string) | topicsStr := record["topics"].(string) | ||||
| topicsStr = strings.Replace(topicsStr, "\"", "", -1) | |||||
| topicsStr = topicsStr[1 : len(topicsStr)-1] | |||||
| log.Info("record[\"topics\"]=" + topicsStr) | |||||
| topicstmp := strings.Split(topicsStr, ",") | |||||
| record["topics"] = topicstmp | |||||
| if topicsStr != "null" { | |||||
| topicsStr = strings.Replace(topicsStr, "\"", "", -1) | |||||
| topicsStr = topicsStr[1 : len(topicsStr)-1] | |||||
| log.Info("record[\"topics\"]=" + topicsStr) | |||||
| topicstmp := strings.Split(topicsStr, ",") | |||||
| record["topics"] = topicstmp | |||||
| } | |||||
| } | } | ||||
| if recordSource["avatar"] != nil { | if recordSource["avatar"] != nil { | ||||
| record["avatar"] = setting.AppSubURL + "/repo-avatars/" + recordSource["avatar"].(string) | record["avatar"] = setting.AppSubURL + "/repo-avatars/" + recordSource["avatar"].(string) | ||||