Rubber v0.9.0 Rubber.Document
The document APIs expose CRUD operations on documents.
Link to this section Summary
Functions
Deletes the documents matching the given id
Deletes the documents matching the given query
using the
Delete By Query API
Fetches a document matching the given id
(Re)Indexes a document with the given id
Indexes a new document
Fetches multiple documents matching the given query
using the
Multi Get API
Updates the document with the given id
Link to this section Functions
Link to this function
delete(elastic_url, index_name, type_name, id, query_params \\ [])
Deletes the documents matching the given id
.
Examples
iex> Rubber.Document.delete("http://localhost:9200", "twitter", "tweet", "42")
{:ok, %HTTPoison.Response{...}}
Link to this function
delete_matching(elastic_url, index_name, query, query_params \\ [])
delete_matching( elastic_url :: String.t(), index :: String.t(), query :: map(), query_params :: Keyword.t() ) :: Rubber.HTTP.resp()
Deletes the documents matching the given query
using the
Delete By Query API.
Link to this function
get(elastic_url, index_name, type_name, id, query_params \\ [])
Fetches a document matching the given id
.
Examples
iex> Rubber.Document.get("http://localhost:9200", "twitter", "tweet", "42")
{:ok, %HTTPoison.Response{...}}
Link to this function
index(elastic_url, index_name, type_name, id, data, query_params \\ [])
(Re)Indexes a document with the given id
.
Examples
iex> Rubber.Document.index("http://localhost:9200", "twitter", "tweet", "42", %{user: "kimchy", post_date: "2009-11-15T14:12:12", message: "trying out Rubber"})
{:ok, %HTTPoison.Response{...}}
Link to this function
index_new(elastic_url, index_name, type_name, data, query_params \\ [])
Indexes a new document.
Examples
iex> Rubber.Document.index_new("http://localhost:9200", "twitter", "tweet", %{user: "kimchy", post_date: "2009-11-15T14:12:12", message: "trying out Rubber"})
{:ok, %HTTPoison.Response{...}}
Link to this function
mget(elastic_url, query, index_name \\ nil, type_name \\ nil, query_params \\ [])
Fetches multiple documents matching the given query
using the
Multi Get API.
Link to this function
update(elastic_url, index_name, type_name, id, data, query_params \\ [])
Updates the document with the given id
.
Examples
iex> Rubber.Document.update("http://localhost:9200", "twitter", "tweet", "42", %{user: "kimchy", message: "trying out Rubber.Document.update/5"})
{:ok, %HTTPoison.Response{...}}