Rubber v0.9.0 Rubber.Index
The indices APIs are used to manage individual indices, index settings, aliases, mappings, and index templates.
Link to this section Summary
Link to this section Functions
Link to this function
close(elastic_url, name)
close(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Closes the specified index.
Examples
iex> Rubber.Index.close("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function
create(elastic_url, name, data)
create(elastic_url :: String.t(), name :: String.t(), data :: map()) :: Rubber.HTTP.resp()
Creates a new index.
Examples
iex> Rubber.Index.create("http://localhost:9200", "twitter", %{})
{:ok, %HTTPoison.Response{...}}
Link to this function
delete(elastic_url, name)
delete(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Deletes an existing index.
Examples
iex> Rubber.Index.delete("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function
exists?(elastic_url, name)
exists?(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Returns true
if the specified index exists, false
otherwise.
Examples
iex> Rubber.Index.exists?("http://localhost:9200", "twitter")
{:ok, false}
iex> Rubber.Index.create("http://localhost:9200", "twitter", %{})
{:ok, %HTTPoison.Response{...}}
iex> Rubber.Index.exists?("http://localhost:9200", "twitter")
{:ok, true}
Link to this function
get(elastic_url, name)
get(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Fetches info about an existing index.
Examples
iex> Rubber.Index.get("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function
open(elastic_url, name)
open(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Opens the specified index.
Examples
iex> Rubber.Index.open("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
Link to this function
refresh(elastic_url, name)
refresh(elastic_url :: String.t(), name :: String.t()) :: Rubber.HTTP.resp()
Forces the refresh of the specified index.
Examples
iex> Rubber.Index.refresh("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}