|
|
|
@@ -174,6 +174,7 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) |
|
|
|
record := make(map[string]interface{}) |
|
|
|
record["id"] = hit.Id |
|
|
|
record["name"] = getLabelValue("name", recordSource, hit.Highlight) |
|
|
|
record["real_name"] = recordSource["name"] |
|
|
|
record["owner_name"] = recordSource["owner_name"] |
|
|
|
if recordSource["description"] != nil { |
|
|
|
desc := getLabelValue("description", recordSource, hit.Highlight) |
|
|
|
@@ -187,7 +188,12 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) |
|
|
|
record["num_forks"] = recordSource["num_forks"] |
|
|
|
record["topics"] = recordSource["topics"] |
|
|
|
if record["topics"] != nil { |
|
|
|
log.Info("record[\"topics\"]=" + 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 recordSource["avatar"] != nil { |
|
|
|
record["avatar"] = setting.AppSubURL + "/repo-avatars/" + recordSource["avatar"].(string) |
|
|
|
|