Jianghan 2 年之前
父節點
當前提交
f5239e6b31
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      elastic/elasticSim.go

+ 1 - 1
elastic/elasticSim.go

@@ -166,7 +166,7 @@ func (e *Elastic) BulkSave(index string, obj *[]map[string]interface{}, isDelBef
 			if isDelBefore {
 				req = req.Add(es.NewBulkDeleteRequest().Index(index).Id(fmt.Sprintf("%v", v["_id"])))
 			}
-			req = req.Add(es.NewBulkIndexRequest().Index(index).Id(fmt.Sprintf("%v", v["_id"])).Doc(v))
+			req = req.Add(es.NewBulkIndexRequest().Index(index).Doc(v))
 		}
 		_, err := req.Do(context.Background())
 		if err != nil {