advancedsearch
is a format for specifying complex search queries to a REST API
Queries are specified by passing a JSON string as a URL parameter. The encoded JSON object represents the nested query.
Queries are made up of nested and
and or
nodes. The leaves of the query trees
are condition nodes, which can use the following supported conditions:
eq
: True when the field value for a resource equals the provided valuelt
: True when the field value for a resource is less than the provided valuele
: True when the field value for a resource is less than, or equal to, the provided valuegt
: True when the field value for a resource is greater than the provided valuege
: True when the field value for a resource is greater than, or equal to, the provided valuelike
: True when the field value for a resource is "LIKE" the provided value. Use %
wildcards as you would in a SQL query.
The example below will match resources that have their name
field equal to "foo" or their date
field between "2020-01-01" and "2020-01-20"
{ "t": "or", "c": [ { "t": "and", "c": [ { "t": "gt", "f": "date", "v": "2020-01-01" }, { "t": "lt", "f": "date", "v": "2020-01-20" } ] }, { "t": "eq", "f": "name", "v": "foo" } ] }
The API using advancedsearch may limit the complexity of queries to avoid overutilization of computing resources by API consumers. When this happens, it will return a response that indicates your query was too costly to perform.