|
@@ -34,6 +34,10 @@ func InitESClient() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func Search(ctx *context.Context) { |
|
|
func Search(ctx *context.Context) { |
|
|
|
|
|
log.Info("search template.") |
|
|
|
|
|
if ctx.Query("q") == "" { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
keyword := strings.Trim(ctx.Query("q"), " ") |
|
|
keyword := strings.Trim(ctx.Query("q"), " ") |
|
|
ctx.Data["Keyword"] = keyword |
|
|
ctx.Data["Keyword"] = keyword |
|
|
ctx.Data["SortType"] = "newest" |
|
|
ctx.Data["SortType"] = "newest" |
|
|