添加协程结构

This commit is contained in:
2025-08-13 07:11:17 +08:00
parent eb5a502d67
commit fda6593f80
4 changed files with 83 additions and 2 deletions

View File

@@ -7,7 +7,6 @@ import (
"toutoukan/model/article"
)
// 全局索引变量,避免重复创建
var GlobalIndex bleve.Index
func DataSearch(c *gin.Context) {
@@ -78,7 +77,7 @@ func DataSearch(c *gin.Context) {
}
c.JSON(200, gin.H{
"total": len(results), // 返回实际有效结果数
"total": len(results),
"took": searchResult.Took,
"result": results,
})