From edd294a7313484f5c6684b3b2e92c2a9453d5777 Mon Sep 17 00:00:00 2001 From: XiaoK29 <1526783667@qq.com> Date: Tue, 14 Jun 2022 20:33:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=B4=A2=E5=BC=95=E9=87=8D=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/service/index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/service/index.go b/web/service/index.go index ead7ff8..a93ac1b 100644 --- a/web/service/index.go +++ b/web/service/index.go @@ -22,10 +22,10 @@ func (i *Index) AddIndex(dbName string, request *model.IndexDoc) { } // BatchAddIndex 批次添加索引 -func (i *Index) BatchAddIndex(dbName string, documents []model.IndexDoc) { +func (i *Index) BatchAddIndex(dbName string, documents []*model.IndexDoc) { db := i.Container.GetDataBase(dbName) for _, doc := range documents { - go db.IndexDocument(&doc) + go db.IndexDocument(doc) } } From 10199ee15119c9056c6fdaa0d83c1da02db60536 Mon Sep 17 00:00:00 2001 From: XiaoK29 <1526783667@qq.com> Date: Tue, 14 Jun 2022 20:36:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=B4=A2=E5=BC=95=E9=87=8D=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/controller/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/controller/index.go b/web/controller/index.go index 45a70e6..5b013f7 100644 --- a/web/controller/index.go +++ b/web/controller/index.go @@ -25,7 +25,7 @@ func AddIndex(c *gin.Context) { // BatchAddIndex 批量添加索引 func BatchAddIndex(c *gin.Context) { - documents := make([]model.IndexDoc, 0) + documents := make([]*model.IndexDoc, 0) if err := c.BindJSON(&documents); err != nil { ResponseErrorWithMsg(c, err.Error()) return