Open and Close indices

This commit is contained in:
Marin Bek 2016-09-07 15:34:49 +02:00
parent 8413c690d4
commit d2a91702fd

24
goes.go
View File

@ -605,3 +605,27 @@ func (c *Connection) AliasExists(alias string) (bool, error) {
return resp.Status == 200, err return resp.Status == 200, err
} }
// CloseIndex closes an index represented by a name
func (c *Connection) CloseIndex(name string) (*Response, error) {
r := Request{
Conn: c,
IndexList: []string{name},
method: "POST",
api: "_close",
}
return r.Run()
}
// OpenIndex opens an index represented by a name
func (c *Connection) OpenIndex(name string) (*Response, error) {
r := Request{
Conn: c,
IndexList: []string{name},
method: "POST",
api: "_open",
}
return r.Run()
}