- Type:
string - Default:
""(no filters) - Scope:
search
filters parameter lets you specify numeric,
facet, and tag filters using an SQL-like syntax with support for boolean operators and parentheses.
Usage
- All filterable attributes must be listed in
attributesForFaceting, except for_tags, which is always available. - You can combine filters using
AND,OR, andNOT, and group expressions with parentheses. - Use quotes for:
- Attribute names or values with spaces.
- Values that conflict with keywords (
AND,OR,NOT). - Values that contain single (
') or double (") quotes.
Filter types
-
Facet filters
Syntax:
facet:value
Example:category:Book
→ Matches records wherecategoryisBookFacet names are case-sensitive, facet values are not. -
Boolean filters
Syntax:
facet:trueorfacet:false
Example:isEnabled:true
→ Matches records whereisEnabledistrueor"true" -
Numeric comparisons
Syntax:
facet <operator> value
Operators:<,<=,=,!=,>=,>
Example:price > 12.99 -
Numeric ranges
Syntax:
facet:low TO high
Example:price:5.99 TO 100
→ Includes both bounds. -
Tag filters
Syntax:
_tags:valueorvalue
Example:published
→ Matches records where_tagsispublished.
Tag matching is case-sensitive. -
Array attributes
A filter matches if it matches any element in the array.
Example:
genres:thrillermatchesgenres: ["fiction", "thriller", "sci-fi"]. -
Nested attributes
You can filter nested fields if they’re declared in
attributesForFaceting. Example:authors.mainAuthor:"John Doe".
Examples
Apply filters on a search query
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Complex filters
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Attributes with spaces
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Attributes conflicting with keywords
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Attributes with single quotes
Current API clients
Current API clients
Legacy API clients
Legacy API clients
Attributes with double quotes
Current API clients
Current API clients
Legacy API clients
Legacy API clients