Giza.Http (giza_sphinxsearch v1.0.7)
Query building helper functions for HTTP Sphinx API requests and responses. Add customizations such as limits and matches to a query. When Sphinx 3.x is released this library will become much more fleshed out; however in the meantime it should satisfy most production search needs.
Link to this section Summary
Functions
Returns an api query augmented with a table to select from. Currently in this first version of the api only one table can be selected from.
Returns an api query augmented with a limit for amount of returned documents. Note that Sphinx also allows for setting an internal limit in configuration. Only an integer is acceptable input.
Returns an api query augmented with a where clause which will be formated as a MATCH query, a common way of asking Sphinx for search matches.
Return a http api query structure with default values
Returns an api query augmented with a limit for amount of returned documents. Only an integer is acceptable input. This is normally used to support pagination.
Return an api query augmented with a select statement. Either a string (binary) or list of fields is acceptable input.
Returns an api query augmented with a free form where clause. Usually not needed as other helpers will format most types of where queries.
Link to this section Functions
from(http_query, table)
Returns an api query augmented with a table to select from. Currently in this first version of the api only one table can be selected from.
Examples
iex> Giza.Http.new() |> Giza.Http.from("posts")
limit(http_query, limit)
Returns an api query augmented with a limit for amount of returned documents. Note that Sphinx also allows for setting an internal limit in configuration. Only an integer is acceptable input.
Examples
iex> Giza.Http.new() |> Giza.Http.limit(1)
match(http_query, search_term)
Returns an api query augmented with a where clause which will be formated as a MATCH query, a common way of asking Sphinx for search matches.
Examples
iex> Giza.Http.new() |> Giza.Http.match("Subetei the Swift")
new()
Return a http api query structure with default values
Examples
iex> Giza.http.new() |> ...
offset(http_query, offset)
Returns an api query augmented with a limit for amount of returned documents. Only an integer is acceptable input. This is normally used to support pagination.
Examples
iex> Giza.Http.new() |> Giza.Http.offset(10)
select(http_query, fields)
Return an api query augmented with a select statement. Either a string (binary) or list of fields is acceptable input.
Examples
iex> Giza.Http.new() |> Giza.Http.select(["title", "body", "id"])
send(query)
where(http_query, where)
Returns an api query augmented with a free form where clause. Usually not needed as other helpers will format most types of where queries.
Examples
iex> Giza.Http.new() |> Giza.Http.where("MATCH('tengri')")