Search Query
How to build a Search Query
This 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, numerical comparison or boolean. e.g. user.myAttribute:="myValue" |
last_updated | string (datetime) | > , < , >= , <= |
none | supports ISO8601 date time, quoted string (eg. “2023-06-02T09:57:55.264631”) (request example. last_updated:>="2023-06-02T09:57:55.264631" ) |
userProperties field has no restriction regarding the data you can put in it (Arrays, Object, Boolean, String, Numeric…) but you can only query for text matching, numerical comparison or boolean.
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. |
#t |
Return assets with true values stored as boolean in user.properties |
#f |
Return assets with false values stored as boolean in user.properties |
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"
Usage limits
The following usage limits are in place for the Search API on the stores/search
query:
- Maximum of 25 queries per second (QPS) per Project (so possibly the sum of client-side and server-side queries)