Jianghan %!s(int64=2) %!d(string=hai) anos
pai
achega
8abe1226ec
Modificáronse 1 ficheiros con 1 adicións e 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))
 		}