_optimize was renamed to _forcemerge in ES 2.1.0
This commit is contained in:
		
							parent
							
								
									4b35e6f0cf
								
							
						
					
					
						commit
						a6663ce61d
					
				
							
								
								
									
										8
									
								
								goes.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								goes.go
									
									
									
									
									
								
							| @ -119,10 +119,18 @@ func (c *Client) Optimize(indexList []string, extraArgs url.Values) (*Response, | ||||
| 		Method:    "POST", | ||||
| 		API:       "_optimize", | ||||
| 	} | ||||
| 	if version, _ := c.Version(); version > "2.1" { | ||||
| 		r.API = "_forcemerge" | ||||
| 	} | ||||
| 
 | ||||
| 	return c.Do(&r) | ||||
| } | ||||
| 
 | ||||
| // ForceMerge is the same as Optimize, but matches the naming of the endpoint as of ES 2.1.0
 | ||||
| func (c *Client) ForceMerge(indexList []string, extraArgs url.Values) (*Response, error) { | ||||
| 	return c.Optimize(indexList, extraArgs) | ||||
| } | ||||
| 
 | ||||
| // Stats fetches statistics (_stats) for the current elasticsearch server
 | ||||
| func (c *Client) Stats(indexList []string, extraArgs url.Values) (*Response, error) { | ||||
| 	r := Request{ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user