trubo_ecto v0.1.1 Trubo.Ecto.Hooks.Search

Single Table Search

Link to this section Summary

Functions

Returns searching queryable

Link to this section Functions

Link to this function run(queryable, search_params)

Returns searching queryable.

Example

iex> params = %{"q" => %{"name_like" => "name", "body_like" => "body"}}
iex> Trubo.Ecto.Hooks.Search.run(Trubo.Ecto.Product, params)
#Ecto.Query<from p in Trubo.Ecto.Product, where: like(p.body, ^"%body%"), where: like(p.name, ^"%name%")>