diff --git a/models/dbsql/issue_foreigntable_for_es.sql b/models/dbsql/issue_foreigntable_for_es.sql index 30fa015500..d6a16cd27c 100644 --- a/models/dbsql/issue_foreigntable_for_es.sql +++ b/models/dbsql/issue_foreigntable_for_es.sql @@ -193,6 +193,7 @@ $def$ name=NEW.name, is_closed=NEW.is_closed, num_comments=NEW.num_comments, + updated_unix=NEW.updated_unix, comment=(select array_to_string(array_agg(content order by created_unix desc),',') from public.comment where issue_id=NEW.id) where id=NEW.id; return new; diff --git a/routers/search.go b/routers/search.go index bc1bc5fac3..c5655b9e14 100644 --- a/routers/search.go +++ b/routers/search.go @@ -573,7 +573,8 @@ func trimFontHtml(text []rune) string { startRune := rune('<') endRune := rune('>') count := 0 - for i := 0; i < len(text); i++ { + i := 0 + for ; i < len(text); i++ { if text[i] == startRune { //start < re := false j := i + 1 @@ -592,11 +593,14 @@ func trimFontHtml(text []rune) string { } else { return string(text[0:i]) } - } } } - return string(text) + if count%2 == 1 { + return string(text[0:i]) + "" + } else { + return string(text[0:i]) + } } func trimHrefHtml(result string) string { @@ -1125,7 +1129,7 @@ func makePrivateIssueOrPr(issues []*models.Issue, res *SearchRes, Key string, la record["num_comments"] = issue.NumComments record["is_closed"] = issue.IsClosed record["updated_unix"] = issue.UpdatedUnix - record["updated_html"] = timeutil.TimeSinceUnix(repo.UpdatedUnix, language) + record["updated_html"] = timeutil.TimeSinceUnix(issue.UpdatedUnix, language) res.Result = append(res.Result, record) } }