diff --git a/public/home/search.js b/public/home/search.js index 13d044e89..73a39cf49 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -157,7 +157,7 @@ function displayRepoResult(page,jsonResult,onlyReturnNum,keyword){ } html += "
"; html += "
"; - html += " " + recordMap["owner_name"] +" / " + recordMap["name"] + ""; + html += " " + recordMap["owner_name"] +" / " + recordMap["name"] + ""; html +=" "; html +="
"; html += "
"; diff --git a/routers/search.go b/routers/search.go index 63b867e18..510ac0339 100644 --- a/routers/search.go +++ b/routers/search.go @@ -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)