View Source Elastix.Index (Elastix Search v1.0.1)
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
@spec close(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()
Closes the specified index.
examples
Examples
iex> Elastix.Index.close("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
@spec create(elastic_url :: String.t(), name :: String.t(), data :: map()) :: Elastix.HTTP.resp()
Creates a new index.
examples
Examples
iex> Elastix.Index.create("http://localhost:9200", "twitter", %{})
{:ok, %HTTPoison.Response{...}}
@spec delete(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()
Deletes an existing index.
examples
Examples
iex> Elastix.Index.delete("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
@spec exists?(elastic_url :: String.t(), name :: String.t()) :: {:ok, boolean()} | {:error, HTTPoison.Error.t()}
Returns true
if the specified index exists, false
otherwise.
examples
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}
@spec get(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()
Fetches info about an existing index.
examples
Examples
iex> Elastix.Index.get("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
@spec open(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()
Opens the specified index.
examples
Examples
iex> Elastix.Index.open("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}
@spec refresh(elastic_url :: String.t(), name :: String.t()) :: Elastix.HTTP.resp()
Forces the refresh of the specified index.
examples
Examples
iex> Elastix.Index.refresh("http://localhost:9200", "twitter")
{:ok, %HTTPoison.Response{...}}