Elasticsearch:6.8.4
Goland:1.13.1
func IsExistsIndex(idx string)bool{
res, err := es.Cat.Indices(
es.Cat.Indices.WithIndex(idx),
)
if err != nil {
fmt.Println(err.Error())
return false
}
if res.StatusCode == 200 {
return true
}
return false
}