Jianghan 2 лет назад
Родитель
Сommit
8abe1226ec
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))
 		}