From 6658b717a8ce681a761f0f48fc28dcf82276f7fc Mon Sep 17 00:00:00 2001 From: zhoushuyu Date: Thu, 23 Nov 2023 12:47:53 +0000 Subject: [PATCH] =?UTF-8?q?update=20es/doc=5Foperation.go.=20=E5=B0=86bulk?= =?UTF-8?q?CreateRequest=20:=3D=20elastic.NewBulkCreateRequest().Index(ind?= =?UTF-8?q?exName)=E6=9B=BF=E6=8D=A2=E4=B8=BAbulkCreateRequest=20:=3D=20el?= =?UTF-8?q?astic.NewBulkCreateRequest().Index(indexName).Doc(doc.Doc)=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=89=B9=E9=87=8F=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=5Fsource?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoushuyu --- es/doc_operation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es/doc_operation.go b/es/doc_operation.go index 63755895..77c36abe 100644 --- a/es/doc_operation.go +++ b/es/doc_operation.go @@ -71,7 +71,7 @@ func (c *Client) BulkCreate(indexName, id, routing string, doc interface{}) { func (c *Client) BulkCreateDocs(ctx context.Context, indexName string, docs []*BulkCreateDoc) (*elastic.BulkResponse, error) { bulkService := c.Client.Bulk().ErrorTrace(true) for _, doc := range docs { - bulkCreateRequest := elastic.NewBulkCreateRequest().Index(indexName) + bulkCreateRequest := elastic.NewBulkCreateRequest().Index(indexName).Doc(doc.Doc) if len(doc.ID) > 0 { bulkCreateRequest.Id(doc.ID) } -- Gitee