Elastix.Index (Elastix v0.10.0) View Source

The indices APIs are used to manage individual indices, index settings, aliases, mappings, and index templates.

Elastic documentation

Link to this section Summary

Functions

Closes the specified index.

Creates a new index.

Deletes an existing index.

Returns true if the specified index exists, false otherwise.

Fetches info about an existing index.

Opens the specified index.

Forces the refresh of the specified index.

Link to this section Functions

Link to this function

close(elastic_url, name)

View Source

Specs

close(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()

Closes the specified index.

Examples

iex> Elastix.Index.close("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function

create(elastic_url, name, data)

View Source

Specs

create(elastic_url :: String.t(), name :: String.t(), data :: map()) ::
  Elastix.HTTP.resp()

Creates a new index.

Examples

iex> Elastix.Index.create("http://localhost:9200", "twitter", %{})
{:ok, %HTTPoison.Response{...}}
Link to this function

delete(elastic_url, name)

View Source

Specs

delete(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()

Deletes an existing index.

Examples

iex> Elastix.Index.delete("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function

exists?(elastic_url, name)

View Source

Specs

exists?(elastic_url :: String.t(), name :: String.t()) ::
  {:ok, boolean()} | {:error, HTTPoison.Error.t()}

Returns true if the specified index exists, false otherwise.

Examples

iex> Elastix.Index.exists?("http://localhost:9200", "twitter")
{:ok, false}
iex> Elastix.Index.create("http://localhost:9200", "twitter", %{})
{:ok, %HTTPoison.Response{...}}
iex> Elastix.Index.exists?("http://localhost:9200", "twitter")
{:ok, true}

Specs

get(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()

Fetches info about an existing index.

Examples

iex> Elastix.Index.get("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}

Specs

open(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()

Opens the specified index.

Examples

iex> Elastix.Index.open("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function

refresh(elastic_url, name)

View Source

Specs

refresh(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()

Forces the refresh of the specified index.

Examples

iex> Elastix.Index.refresh("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}