Snap.Indexes (Snap v0.13.0)
View SourceHelper functions around index management.
Summary
Functions
Creates an alias for a versioned index, removing any existing aliases.
Deletes older timestamped indexes.
Closes an open index.
Creates an index.
Deletes an index.
Get an index's mapping.
Get an index's setting using a comma separate list or wildcard expression
Get all of the index's settings.
Get an index's shard stores.
Get an index's stats using a metric. Metric is a comma separated list of metrics.
Get an index's stats.
Creates and loads a new index, switching the alias to it with zero-downtime.
Lists all the indexes in the cluster.
Lists all the timestamp versioned indexes starting with the prefix.
Opens a closed index.
Refreshes an index.
Updates the given index's mapping.
Update an index's settings.
Functions
@spec alias(module(), String.t(), String.t(), Keyword.t()) :: :ok | Snap.Cluster.error()
Creates an alias for a versioned index, removing any existing aliases.
@spec cleanup(module(), String.t(), non_neg_integer(), Keyword.t()) :: :ok | Snap.Cluster.error()
Deletes older timestamped indexes.
@spec close(module(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Closes an open index.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-close.html
@spec create(module(), String.t(), map(), Keyword.t()) :: Snap.Cluster.result()
Creates an index.
@spec delete(module(), String.t(), Keyword.t()) :: Snap.Cluster.result()
Deletes an index.
@spec get_mapping(module(), String.t(), Keyword.t()) :: Snap.Cluster.result()
Get an index's mapping.
@spec get_setting(module(), String.t(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Get an index's setting using a comma separate list or wildcard expression
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
@spec get_settings(module(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Get all of the index's settings.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
@spec get_shard_stores(module(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Get an index's shard stores.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html
Get an index's stats using a metric. Metric is a comma separated list of metrics.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html
@spec get_stats(module(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Get an index's stats.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html
@spec hotswap(Enumerable.t(), module(), String.t(), map(), Keyword.t()) :: :ok | Snap.Cluster.error() | {:error, Snap.BulkError.t()}
Creates and loads a new index, switching the alias to it with zero-downtime.
Takes an Enumerable
of Snap.Bulk
actions, and builds a new index from
it. Refreshes it, updates the alias to it, and cleans up the old indexes,
leaving the previous one behind.
May return Snap.Cluster.error/0
or a Snap.BulkError
containing a list
of failed bulk actions.
@spec list(module(), Keyword.t()) :: {:ok, [String.t()]} | Snap.Cluster.error()
Lists all the indexes in the cluster.
@spec list_starting_with(module(), String.t(), Keyword.t()) :: {:ok, [String.t()]} | Snap.Cluster.error()
Lists all the timestamp versioned indexes starting with the prefix.
@spec open(module(), String.t(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Opens a closed index.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
@spec refresh(cluster :: module(), index :: String.t(), opts :: Keyword.t()) :: :ok | Snap.Cluster.error()
Refreshes an index.
@spec update_mapping(module(), String.t(), map(), Keyword.t()) :: Snap.Cluster.result()
Updates the given index's mapping.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
@spec update_settings(module(), String.t(), map(), Keyword.t(), Keyword.t()) :: Snap.Cluster.result()
Update an index's settings.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html