Overview
Spree provides powerful search, filtering, and sorting capabilities for products and other resources. The Store API supports:- Full-text search across product names and SKUs
- Attribute-based filtering (price range, availability, stock status)
- Category and taxon filtering
- Faceted search with filter counts
- Flexible sorting options
Product Search
Use thesearch parameter for full-text search across product fields:
Filtering Products
By Price Range
By Availability
By Category
By Tags
Sorting
Product Filters (Faceted Search)
Get available filter options for building a faceted search UI. Returns an array of typed filter objects (price range, availability, option types, categories) with counts, plus sort and pagination metadata:Filtering Other Resources
The Store API uses query parameters prefixed withq[] for filtering any resource collection. Common filter predicates:
Equality Predicates
| Predicate | Description | Example |
|---|---|---|
eq | Equals | q[status_eq]=active |
not_eq | Not equals | q[status_not_eq]=archived |
in | In array | q[id_in][]=1&q[id_in][]=2 |
String Predicates
| Predicate | Description | Example |
|---|---|---|
cont | Contains | q[name_cont]=shirt |
start | Starts with | q[name_start]=spree |
end | Ends with | q[email_end]=@example.com |
i_cont | Case-insensitive contains | q[name_i_cont]=SHIRT |
Comparison Predicates
| Predicate | Description | Example |
|---|---|---|
gt | Greater than | q[price_gt]=50 |
gteq | Greater than or equal | q[quantity_gteq]=10 |
lt | Less than | q[price_lt]=100 |
lteq | Less than or equal | q[created_at_lteq]=2025-12-31 |
NULL Predicates
| Predicate | Description | Example |
|---|---|---|
null | Is NULL | q[deleted_at_null]=true |
not_null | Is not NULL | q[published_at_not_null]=true |
present | Is not NULL and not empty | q[image_present]=true |
Only attributes explicitly allowed by each resource can be used for filtering. Attempting to filter on unsupported fields will be silently ignored.
Pagination
All list endpoints support pagination:Search Providers
Spree uses a pluggable search provider architecture. The default provider uses SQL (ILIKE + Ransack). For production catalogs with 1,000+ products, we recommend switching to Meilisearch for typo tolerance, relevance ranking, and faster faceted search.q[search], filter params, and sort options work with any provider.
See Build a Custom Search Provider for architecture details and how to build custom providers.
Related Documentation
- Products — Product catalog and listing
- Store SDK Products —
client.products.list()options and methods - Querying — Store API filtering, sorting, and pagination reference
- Admin API querying — Admin API filtering, sorting, and pagination reference
- Build a Custom Search Provider — Step-by-step guide
- Meilisearch Integration — Setup guide

