Elastix.Mapping (Elastix v0.10.0) View Source
The mapping API is used to define how documents are stored and indexed.
Link to this section Summary
Functions
Gets info on one or a list of mappings for one or a list of indices.
Gets info on every mapping.
Gets info on every given mapping.
Creates a new mapping.
Link to this section Functions
Specs
get( elastic_url :: String.t(), index_names :: String.t() | list(), type_names :: String.t() | list(), query_params :: Keyword.t() ) :: Elastix.HTTP.resp()
Gets info on one or a list of mappings for one or a list of indices.
Examples
iex> Elastix.Mapping.get("http://localhost:9200", "twitter", "tweet")
{:ok, %HTTPoison.Response{...}}
Specs
get_all(elastic_url :: String.t(), query_params :: Keyword.t()) :: Elastix.HTTP.resp()
Gets info on every mapping.
Examples
iex> Elastix.Mapping.get_all("http://localhost:9200")
{:ok, %HTTPoison.Response{...}}
Specs
get_all_with_type( elastic_url :: String.t(), type_names :: String.t() | list(), query_params :: Keyword.t() ) :: Elastix.HTTP.resp()
Gets info on every given mapping.
Examples
iex> Elastix.Mapping.get_all("http://localhost:9200", ["tweet", "user"])
{:ok, %HTTPoison.Response{...}}
Link to this function
put(elastic_url, index_names, type_name, data, query_params \\ [])
View SourceSpecs
put( elastic_url :: String.t(), index_names :: String.t() | list(), type_name :: String.t(), data :: map(), query_params :: Keyword.t() ) :: Elastix.HTTP.resp()
Creates a new mapping.
Examples
iex> mapping = %{properties: %{user: %{type: "text"}, post_date: %{type: "date"}, message: %{type: "text"}}}
iex> Elastix.Mapping.put("http://localhost:9200", "twitter", "tweet", mapping)
{:ok, %HTTPoison.Response{...}}