Open and Close indices
This commit is contained in:
parent
8413c690d4
commit
d2a91702fd
24
goes.go
24
goes.go
@ -605,3 +605,27 @@ func (c *Connection) AliasExists(alias string) (bool, error) {
|
||||
|
||||
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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user