Skip to content

v0.4.0 Release

Compare
Choose a tag to compare
@nickcanz nickcanz released this 28 Feb 16:06
0ddc377

This release adds some features around managing indices.

Breaking Changes

  • Renamed ClusterSettings struct to Settings - This struct is now used when listing Cluster or Index settings.
  • Renamed func (c *Client) GetSettings() method to func (c *Client) GetClusterSettings() to differentiate between Cluster or Index settings.
  • Renamed func (c *Client) SetSetting method to func (c *Client) SetClusterSetting to differentitate between Cluster or Index settings.
  • Added indexSettings map[string]interface{} to the arguments of func (c *Client) RestoreSnapshotIndices to allow setting specific index settings when restoring an index.

New APIs

  • func (c *Client) DeleteIndex(indexName string) error - Deleting an index
  • func (c *Client) GetPrettyIndexSettings(index string) (string, error) - Get a human readable JSON of the settings of an index
  • func (c *Client) GetIndexSettings(index string) ([]Setting, error) - Get the settings of an index
  • func (c *Client) SetIndexSetting(index, setting, value string) (string, string, error) - Set the settings of an index
  • func (c *Client) GetPrettyIndexMappings(index string) - Get a human readable JSON of the mappings of an index
  • func (c *Client) AnalyzeText(analyzer, text string) ([]Token, error) - Call the Elasticsearch analyze API to preview how given text will be broken down into tokens.
  • func (c *Client) AnalyzeTextWithField(index, field, text string) ([]Token, error) - Call the Elasticsearch analyze API with a specific field to preview how the text will be broken down into tokens for that field.

Changes

  • Added additional fields to the Client struct to support more connection properties
    • Secure - boolean whether to connect using HTTPS or not
    • Auth - struct containing username and password for HTTP basic auth
    • Timeout - set a time.Duration for the API calls to Elasticsearch
    • TLSConfig - set tls.Config options for things like client certificates or ignoring certificate validation