Jianghan hace 2 años
padre
commit
8abe1226ec
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      elastic/elasticSim.go

+ 1 - 1
elastic/elasticSim.go

@@ -164,7 +164,7 @@ func (e *Elastic) BulkSave(index, itype string, obj *[]map[string]interface{}, i
 		req := client.Bulk()
 		for _, v := range *obj {
 			if isDelBefore {
-				req = req.Add(es.NewBulkDeleteRequest().Index(index).Type(itype).Id(fmt.Sprintf("%v", v["id"])))
+				req = req.Add(es.NewBulkDeleteRequest().Index(index).Type(itype).Id(fmt.Sprintf("%v", v["_id"])))
 			}
 			req = req.Add(es.NewBulkIndexRequest().Index(index).Type(itype).Doc(v))
 		}