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

+ 1 - 1
elastic/elasticSim.go

@@ -170,7 +170,7 @@ func (e *Elastic) BulkSave(index string, obj []map[string]interface{}) {
 			id := util.ObjToString(v["_id"])
 			delete(v, "_id")
 			util.Debug(id, v)
-			req = req.Add(es.NewBulkIndexRequest().Index(index).Id(id).Doc(v))
+			req = req.Add(es.NewBulkIndexRequest().Index(index).Type("_doc").Id(id).Doc(v))
 		}
 		_, err := req.Do(context.Background())
 		if err != nil {