Filters
Your filter is always combined with your data product’s segment: a filter can narrow what you see, never widen it.
A filter is a condition, or a group of them:
{ "all": [ { "field": "location.region", "eq": "US-FL" }, { "any": [ { "field": "job.role.rank", "gte": 90 }, { "field": "job.title_raw", "match": "owner" } ] }, { "not": { "field": "company.domain", "in_list": "lst_01JD3K8ZQ4V6W9XG2M5N7P0R1S" } }] }Operators: eq, neq, in, nin, gt, gte, lt, lte, between, exists, prefix, match,
under (a category or place and everything below it), geo_radius, geo_polygon, in_list (one of
your lists) and at_address. GET /v1/fields?entity=person lists every field with
the operators it takes.
The same filters as a small SQL subset, in sql instead of filter:
SELECT * FROM personWHERE location.region = 'US-FL' AND (job.role.rank >= 90 OR MATCH(job.title_raw, 'owner'))ORDER BY job.role.rank DESC LIMIT 25Only SELECT … FROM person|company WHERE … ORDER BY … LIMIT … is accepted, with the functions
UNDER, MATCH, GEO_RADIUS, GEO_POLYGON, IN_LIST and AT_ADDRESS. Joins, subqueries,
comments and other functions are refused.
Errors
Section titled “Errors”A filter the field registry doesn’t accept answers 422 filter.invalid
(or sql.invalid), with one item per problem in errors[], for example filter.unknown_field,
filter.operator, filter.value, or for lists filter.list_not_found, filter.list_kind and
filter.list_too_large.