View Source Haystack.Query.Expression behaviour (Haystack v0.1.0)
A module for defining query expressions.
Link to this section Summary
Callbacks
Evaluate the given clause.
Functions
Build the expression into a statement.
Return the default expressions.
Create a new expression.
Link to this section Types
@type k() :: atom()
Link to this section Callbacks
@callback evaluate(Haystack.Index.t(), t()) :: [map()]
Evaluate the given clause.
Link to this section Functions
@spec build(t()) :: Haystack.Query.statement()
Build the expression into a statement.
examples
Examples
iex> expression = Query.Expression.new(:match, field: "name", term: "Haystack")
iex> Query.Expression.build(expression)
Return the default expressions.
examples
Examples
iex> Query.Expression.default()
Create a new expression.
examples
Examples
iex> Query.Expression.new(:match, field: "name", term: "Haystack")