Jianghan 2 жил өмнө
parent
commit
f1970b57de
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  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))
 		}