Jianghan 2 năm trước cách đây
mục cha
commit
f5239e6b31
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 {