Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 637 Bytes

File metadata and controls

31 lines (25 loc) · 637 Bytes
endpoint indices.delete_alias
lang go
es_version 9.3
client github.com/elastic/go-elasticsearch/v9

Elasticsearch 9.3 indices.delete_alias endpoint (Go example)

Use client.Indices.DeleteAlias() to remove an alias from an index:

_, err := client.Indices.DeleteAlias("products", "shop").
    Do(context.Background())
if err != nil {
    log.Fatalf("Error: %s", err)
}

Multiple aliases

Remove several aliases at once by passing multiple names:

_, err := client.Indices.DeleteAlias("products", "shop,electronics").
    Do(context.Background())
if err != nil {
    log.Fatalf("Error: %s", err)
}