Elastix.Bulk (Elastix v0.10.0) View Source

The bulk API makes it possible to perform many index/delete operations in a single API call.

Elastic documentation

Link to this section Summary

Functions

Excepts a list of actions and sources for the lines parameter.

Same as post/4 but instead of sending a list of maps you must send raw binary data in the format described in the Elasticsearch documentation.

Link to this section Functions

Link to this function

post(elastic_url, lines, options \\ [], query_params \\ [])

View Source

Specs

post(
  elastic_url :: String.t(),
  lines :: list(),
  opts :: Keyword.t(),
  query_params :: Keyword.t()
) :: Elastix.HTTP.resp()

Excepts a list of actions and sources for the lines parameter.

Examples

iex> Elastix.Bulk.post("http://localhost:9200", [%{index: %{_id: "1"}}, %{user: "kimchy"}], index: "twitter", type: "tweet")
{:ok, %HTTPoison.Response{...}}
Link to this function

post_raw(elastic_url, raw_data, options \\ [], query_params \\ [])

View Source

Specs

post_raw(
  elastic_url :: String.t(),
  raw_data :: String.t(),
  opts :: Keyword.t(),
  query_params :: Keyword.t()
) :: Elastix.HTTP.resp()

Same as post/4 but instead of sending a list of maps you must send raw binary data in the format described in the Elasticsearch documentation.

Link to this function

post_to_iolist(elastic_url, lines, options \\ [], query_params \\ [])

View Source

Specs

post_to_iolist(
  elastic_url :: String.t(),
  lines :: list(),
  opts :: Keyword.t(),
  query_params :: Keyword.t()
) :: Elastix.HTTP.resp()

Deprecated: use post/4 instead.