# `Giza.SphinxQL.Recipe`

Query building helper functions for SphinxQL designed in commonly useful ways.  Provides guidance when
trying to take advantage of advanced search functionality without having to know every nuance of sphinx'
query language.

# `match_and_filter`

Search on a string and add on as many filters as wanted. This can be used to add simple constraints to a search.

## Example

    # Show comments for a particular post only by a certain author
    iex> SphinxQL.new()
    |> SphinxQL.from("blog_comments")
    |> SphinxQL.Recipe.match_and_filter("subetei", post_id: 45, author: "Khasar Borjigin")
    |> SphinxQL.send()

    %SphinxqlResponse{ .. }

# `weigh_by_date`

Influence your search results by how recently they were added or updated (or whatever the date field you pass
represents).  For the example below ensure you are selecting the date in your index as a unix timestamp (mysql: 
UNIX_TIMESTAMP(updated_timestamp), postgres: extract(epoch from updated_timestamp)).

## Example

    iex> SphinxQL.new()
    |> SphinxQL.from("blog_posts")
    |> SphinxQL.match("red clown")
    |> SphinxQL.Recipe.weigh_by_date("last_updated_timestamp")
    |> SphinxQL.send()

    %SphinxqlResponse{ .. }

---

*Consult [api-reference.md](api-reference.md) for complete listing*
