csquery v1.0.0 CSQuery.FieldValue View Source
A representation of a field value pattern matcher for the AWS CloudSearch
structured query syntax. If the CSQuery.FieldValue
does not have a name
,
then all text and text-array fields will be searched. If it does have a
name
, then only the named field will be searched.
Link to this section Summary
Types
Valid name types for a CSQuery.FieldValue
struct
The struct for CSQuery.FieldValue
Valid value types for a CSQuery.FieldValue.t/0
Functions
Provide an unnamed CSQuery.FieldValue
struct for the value provided
Provide an optionally named CSQuery.FieldValue
struct. The value
may be
one of values/0
, nil
(which will be converted to ""
), or a Range
(which will be converted to a CSQuery.Range
)
Convert the CSQuery.FieldValue.t/0
to a string
Link to this section Types
Valid name types for a CSQuery.FieldValue
struct.
Note that CSQuery.Expression.operators/0
are not valid field names as
they are reserved keywords in the structured query syntax.
The struct for CSQuery.FieldValue
.
values() :: String.t() | CSQuery.Range.t() | CSQuery.Expression.t() | number() | DateTime.t()
Valid value types for a CSQuery.FieldValue.t/0
.
Link to this section Functions
Provide an unnamed CSQuery.FieldValue
struct for the value provided.
If the value provided is a CSQuery.FieldValue
struct, it will be returned.
If the value provided is a map, the first key and value combination will be
used to construct the CSQuery.FieldValue
struct.
iex> new(%{title: "Star Wars", year: 1990})
%CSQuery.FieldValue{name: :title, value: "Star Wars"}
See new/2
for more information.
new(:and, keyword()) :: CSQuery.Expression.t()
new(:near, keyword()) :: CSQuery.Expression.t()
new(:not, keyword()) :: CSQuery.Expression.t()
new(:or, keyword()) :: CSQuery.Expression.t()
new(:phrase, keyword()) :: CSQuery.Expression.t()
new(:prefix, keyword()) :: CSQuery.Expression.t()
new(:range, keyword()) :: CSQuery.Expression.t()
new(:term, keyword()) :: CSQuery.Expression.t()
new(names(), t()) :: t()
new(names(), values()) :: t()
Provide an optionally named CSQuery.FieldValue
struct. The value
may be
one of values/0
, nil
(which will be converted to ""
), or a Range
(which will be converted to a CSQuery.Range
).
If a CSQuery.FieldValue
struct is provided, a struct with the name
replaced will be returned, effectively naming or renaming the field.
iex> new(:plot, %CSQuery.FieldValue{value: "war"})
%CSQuery.FieldValue{name: :plot, value: "war"}
iex> new(:plot, %CSQuery.FieldValue{name: :title, value: "war"})
%CSQuery.FieldValue{name: :plot, value: "war"}
As a special case, when one of the CSQuery.Expression.operators/0
is
provided as the name
, a CSQuery.Expression
will be built inside of a
CSQuery.FieldValue
struct.
Convert the CSQuery.FieldValue.t/0
to a string.