View Source ExTypesense.Search (ExTypesense v0.4.1)

Module for searching documents.

Summary

Types

Link to this type

response()

View Source (since 0.3.0)
@type response() :: Ecto.Query.t() | {:ok, map()} | {:error, map()}

Functions

Link to this function

search(conn \\ Connection.new(), module_or_collection_name, params)

View Source (since 0.1.0)
@spec search(ExTypesense.Connection.t(), module() | String.t(), map()) :: response()

Search from a document.

Examples

iex> params = %{q: "umbrella", query_by: "title,description"}
iex> ExTypesense.search(Something, params)
{:ok,
 %{
  "facet_counts" => [],
  "found" => 0,
  "hits" => [],
  "out_of" => 0,
  "page" => 1,
  "request_params" => %{
    "collection_name" => "something",
    "per_page" => 10,
    "q" => "umbrella"
  },
  "search_cutoff" => false,
  "search_time_ms" => 5
 }
}