Real-time suggestions with product, collection, and page results. Highlight matching, debounce, and caching.
Predictive Search
Scale Theme's predictive search displays real-time suggestions as soon as the visitor starts typing. Results include products (with images and prices), collections, and pages, all without reloading the page.
How it works
- The visitor clicks on the search icon in the header
- The search field opens (overlay or inline depending on configuration)
- As soon as they start typing (from 2 characters onward), suggestions appear
- Results update in real time with each keystroke
- The visitor can click on a result or press Enter to see all results
Result types
| Type | Display | Information |
|---|---|---|
| Products | Thumbnail + title + price | Up to 6 products |
| Collections | Collection title | Up to 3 collections |
| Pages | Page title | Up to 3 pages |
Product results
Each product displays:
| Element | Description |
|---|---|
| Image | Product thumbnail (first image) |
| Title | Product name with search terms highlighted |
| Price | Current price (and compare-at price if applicable) |
| Vendor | Manufacturer name (optional) |
Search term highlighting
Search terms are automatically highlighted in the results. If the visitor types "black dress", the words "black" and "dress" will be bolded in the matching titles.
Performance
Predictive search uses several optimizations for near-instant results:
Debounce
Requests are sent with a 300ms debounce. This means the request is only sent 300ms after the visitor's last keystroke, avoiding a request for every single character.
| Aspect | Detail |
|---|---|
| Debounce delay | 300ms |
| Minimum characters | 2 before the first request |
| Concurrent requests | Previous requests are canceled if a new one is triggered |
Cache
Search results are cached in memory for previously searched terms:
| Aspect | Detail |
|---|---|
| Strategy | In-memory cache (session) |
| Duration | Until the page is closed |
| Key | Exact search term |
| Invalidation | Automatic on navigation |
Settings
| Setting | Description | Options |
|---|---|---|
| Enable | Enables predictive search | Yes / No |
| Number of products | Products displayed | 2 - 8 |
| Show collections | Include collections | Yes / No |
| Show pages | Include pages | Yes / No |
| Show vendor | Manufacturer name below the title | Yes / No |
| Show price | Price next to the product | Yes / No |
Search opening style
| Setting | Description | Options |
|---|---|---|
| Opening style | How the search opens | Overlay / Inline / Full screen |
| Style | Description |
|---|---|
| Overlay | A search panel opens as an overlay above the content |
| Inline | The search field expands within the header |
| Full screen | The search takes over the entire screen (mobile-first) |
Keyboard navigation
| Key | Action |
|---|---|
| Down arrow | Navigate to the next result |
| Up arrow | Navigate to the previous result |
| Enter | Open the selected result (or launch the full search) |
| Escape | Close the predictive search |
| Tab | Move to the next result |
Mobile behavior
| Aspect | Desktop | Mobile |
|---|---|---|
| Opening | Overlay or inline | Full screen |
| Results | Grid with large images | Compact list |
| Keyboard | Arrow key navigation | Touch keyboard with suggestions |
| Close | Escape / Click overlay | Back button / Swipe |
Shopify API
Predictive search uses Shopify's native Predictive Search API (/search/suggest.json). Results are filtered and formatted on the client side.
| Parameter | Value |
|---|---|
| Endpoint | /search/suggest.json |
| Method | GET |
| Types | product, collection, page |
| Limit | Configurable per type |
Best practices
- Always enable it: Predictive search is a standard that visitors expect. Disabling it hurts the experience
- 6 products: This is the optimal number of product results. Enough to find what you're looking for, not so many as to overwhelm
- Enable collections: Collections help visitors find entire categories, not just individual products
- Test common terms: Verify that the most frequent searches for your store return relevant results