I have array of Profile Ids (uid) and need to delete all these profiles with 1 request.
Here is my code.
func MultipleDeleteFromElastic(index string, inType string, uid string, ct interface{}) error {
client, err := GetElasticCon()
if err != nil {
ElasticConnectError.DeveloperMessage = err.Error()
return ElasticConnectError
}
deleteReq := elastic.NewBulkDeleteRequest().Index(index).Type(inType).Id(uid)
_, err1 := client.Bulk().Add(deleteReq).Do(context.Background())
if err1 != nil {
ElasticConnectError.DeveloperMessage = err1.Error()
return ElasticConnectError
}
return err1
}
What does the bulkDelete need? How I can pass an array in BulkDelete?
I have no idea if I doing this right (obviously I am not).