olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch
https://olivere.github.io/elastic/
MIT License
7.42k stars 1.15k forks source link

Alias Exists or not #1603

Closed superman0987 closed 2 years ago

superman0987 commented 2 years ago

Please use the following questions as a guideline to help me answer your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[ x] elastic.v7 (for Elasticsearch 7.x) [ ] elastic.v6 (for Elasticsearch 6.x) [ ] elastic.v5 (for Elasticsearch 5.x) [ ] elastic.v3 (for Elasticsearch 2.x) [ ] elastic.v2 (for Elasticsearch 1.x)

Please describe the expected behavior

Have some API that can be used to check if alias exists or not.

Please describe the actual behavior

Could not find any such functions or methods.

Again, this is not an issue. Just a query. Is there any code written around this? Or is it not possible to find out if alias exists. No problem either way, just want to know before proceeding with my work.

olivere commented 2 years ago

There is HasAlias on the response of the Get Aliases API (see example code here). AFAIK there is no API to check if an alias exists directly, just these Alias APIs.