Search Query
How to build a Search QueryThis API accepts the query
parameter which is a search query combining one or more search clauses.
Each search clause is made up of three parts structured as field
:
operator
value
. , e.g. name:="My cool store"
Vocabulary
-
Field: attribute of the Store that is searched, e.g. the attribute
name
of the store. -
Operator: test that is performed on the data to provide a match, e.g.
=
. Each field has a default operator. If none operator follow the:
, the default one is used. -
Value: the content of the attribute that is tested, e.g. the name of the store
"My cool store"
.
Combine clauses with the conjunctions AND
or OR
, and negate the query with NOT
.
Fields
Field | ValueType | Operators | Default | Description |
---|---|---|---|---|
type | collection | none | contains | An element is contained within type collection. e.g. type:"myType" |
tag | collection | none | contains | An element is contained within tag collection. e.g. tag:"myTag" |
city | string | none or = |
= |
text matching: the value match the city field. e.g. city:="Paris" |
country | string | none or = |
= |
text matching: the value match the countryCode field. e.g. country:="FR" |
name | string | none or = |
= |
text matching: the value match the name field. e.g. name:="myName" |
idstore | string | none or = |
= |
text matching: the value match the idstore field. e.g. idstore:="myIdStore" |
user. | string, numeric | none or = , > , < , >= , <= |
= |
concerns all fields inside user_properties . text matching or numerical comparison. e.g. user.myAttribute:="myValue" |
Operators
Operator | Description |
---|---|
: |
Default and mandatory operator. For type and tag fields, define that an element is contained within a collection. |
= |
The content of a string or a number is equal to the other. |
> |
A number is greater than another. |
< |
A number is smaller than another. |
>= |
A number is greater than or equal to another. |
<= |
A number is smaller than or equal to another. |
AND |
Return assets that match both clauses. |
OR |
Return assets that match either clauses. |
NOT |
Negates a search clause. |
For compound clauses, you can use parentheses to group clauses together. For example:
(type:"type1" OR type:"type2") AND tag:"hockey"
You can use NOT
operator to negates a search clause. For example:
not type:"type1"