IndicesExist implementation

This commit is contained in:
Marin Bek 2014-11-11 15:39:07 +01:00
parent 92d2eb17fa
commit ebf3324c90

14
goes.go
View File

@ -441,3 +441,17 @@ func (c *Connection) PutMapping(typeName string, mapping map[string]interface{},
return r.Run() 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
}