增加内容可搜索字段,屏蔽各种标记。

This commit is contained in:
2026-08-29 01:40:52 +08:00
parent cfe5cf53aa
commit f216ef4d1b
5 changed files with 125 additions and 34 deletions
+1 -1
View File
@@ -447,7 +447,7 @@ func SearchView(c *gin.Context) {
db := database.DB.Model(&models.Post{}).Preload("Category").Preload("Tags").Preload("Author").
Where("status = ?", "published").
Where("title LIKE ? OR content LIKE ? OR summary LIKE ?",
Where("title LIKE ? OR searchable_text LIKE ? OR summary LIKE ?",
"%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%")
var total int64