diff --git a/goes.go b/goes.go index beb135e..1cf3b38 100644 --- a/goes.go +++ b/goes.go @@ -441,3 +441,17 @@ func (c *Connection) PutMapping(typeName string, mapping map[string]interface{}, return r.Run() } + +// IndicesExist checks whether index (or indices) exist on the server +func (c *Connection) IndicesExist(indexes ...string) (bool, error) { + + r := Request{ + Conn: c, + IndexList: indexes, + method: "HEAD", + } + + resp, err := r.Run() + + return resp.Status == 200, err +}