Search & Filtering
FacetWP v4.3.6 for faceted filtering and WP Search with Algolia v2.8.2 for instant search provide advanced product discovery.
Overview
HHA Sports uses a dual search strategy:
- FacetWP - Faceted filtering on catalog/category pages
- Algolia - Instant search with autocomplete
Both integrate with BigCommerce products and work alongside each other.
FacetWP Integration
Plugin: FacetWP v4.3.6
Location: wp-content/plugins/facetwp/
License: Commercial (FacetWP, LLC)
Purpose
Provide faceted filtering for product catalogs with dynamic refinement based on attributes like brand, category, price, features, etc.
Features
- Multiple Facet Types - Checkboxes, dropdowns, sliders, etc.
- Ajax Refresh - No page reload on filter changes
- URL Parameters - SEO-friendly filter URLs
- Result Count - Display number of matching products
- Pagination - Integrated with filtered results
- Template Overrides - Custom result displays
Add-On Plugins
FacetWP Cache v1.x
Location: wp-content/plugins/facetwp-cache/
Caches facet data and results for improved performance.
FacetWP Range List v1.x
Location: wp-content/plugins/facetwp-range-list/
Custom facet type for displaying ranges as list items instead of sliders.
Theme Integration
Location: wp-content/themes/suma-elementor/inc/integrations/class-facetwp.php
Theme customizations include:
- Custom facet templates
- Result count display
- Pagination styling
- Mobile optimizations
- JavaScript configuration
FacetWP Configuration Object
Theme provides configuration via SUMA.facetwp JavaScript object:
window.SUMA = {
facetwp: {
// Custom configuration
// Loaded via wp_localize_script
}
};
Custom Elementor Widgets
Location: wp-content/themes/suma-elementor/inc/widgets/
FacetWP-specific widgets:
- category-facets - Category filter display
- facet-list - Generic facet list
- facet-mobile-button - Mobile filter toggle
- facet-pagination - Pagination controls
Common Facet Types
Checkboxes
Filter by multiple selections (brand, color, features, etc.)
Dropdown
Single selection (sort order, category)
Slider
Numeric range (price, size)
Range List (Add-On)
Discrete value selection (shoe sizes, shirt sizes)
Configuration
Admin Location: Settings → FacetWP
Facet Setup
- Create facets (Settings → FacetWP → Facets)
- Name, label, data source, facet type
- Display settings
- Advanced settings (URL, indexing)
Template
- Create template (Settings → FacetWP → Templates)
- Query settings (post type, taxonomy, etc.)
- Template code (PHP/HTML)
- Pagination settings
Settings
- Prefix: URL parameter prefix (default:
_) - Load Assets: Where to load FacetWP CSS/JS
- Debug Mode: Enable for troubleshooting
Usage
Display Facets
<?php echo facetwp_display('facet', 'brand'); ?>
<?php echo facetwp_display('facet', 'price'); ?>
<?php echo facetwp_display('facet', 'category'); ?>
Display Template
<?php echo facetwp_display('template', 'products'); ?>
Display Pagination
<?php echo facetwp_display('pager'); ?>
JavaScript Events
// Before facet refresh
$(document).on('facetwp-loaded', function() {
// Custom code after results load
});
// Before facet refresh
$(document).on('facetwp-refresh', function() {
// Custom code before results refresh
});
Filters & Hooks
facetwp_preload_force_query
Applied in theme: __return_true
Forces FacetWP to always run the query (for better integration with other plugins).
Custom Facet Templates
Theme can override facet display via facetwp_facet_html filter.
Integration with BigCommerce
FacetWP indexes BigCommerce product data:
- Product taxonomies - Categories, brands, flags
- Post meta - Price, SKU, custom fields
- ACF fields - Custom product attributes
Mobile Optimization
facet-mobile-button widget - Toggle filter panel on mobile
Typical implementation:
- Hide facets on mobile by default
- Show floating button to open filter panel
- Slide-in panel with facets
- Apply filters and close panel
Caching Considerations
FacetWP Cache add-on caches:
- Facet choices (what options are available)
- Result counts (how many products match)
- Query results (matching product IDs)
Cache invalidated on:
- Product import/update
- Manual cache clear
- Configured expiration time
Algolia Integration
Plugin: WP Search with Algolia v2.8.2
Location: wp-content/plugins/wp-search-with-algolia/
Author: WebDevStudios
License: GPLv2 / MIT
Purpose
Provide instant search with autocomplete, typo tolerance, and synonym support using Algolia's hosted search service.
Features
- Instant Search - Results as you type
- Autocomplete - Dropdown suggestions
- Typo Tolerance - Handles misspellings
- Faceted Search - Filter results on search page
- Synonyms - Configure word equivalents
- Analytics - Search performance tracking
- Multi-Index - Search multiple content types
Theme Integration
Location: wp-content/themes/suma-elementor/inc/integrations/class-algolia.php
Theme customizations:
- Custom search templates
- Result styling
- InstantSearch configuration
- Autocomplete customization
Conditional Loading
Theme loads Algolia scripts only on search pages:
if (defined('ALGOLIA_VERSION') && is_search()) {
wp_enqueue_script('algolia-instantsearch');
wp_enqueue_style('algolia-instantsearch');
}
Custom Elementor Widgets
Location: wp-content/themes/suma-elementor/inc/widgets/
Algolia-specific widgets:
- algolia-autocomplete - Search autocomplete dropdown
- algolia-catalog - Product catalog search
- algolia-instantsearch - Live search results
- algolia-posts - Post search results
- algolia-search - Generic search interface
- suma-search-form - Custom search form
Suma Patches Integration
Location: wp-content/plugins/suma-patches/inc/class-algolia.php
Additional Algolia customizations in Suma Patches plugin.
Configuration
Admin Location: Algolia Search → Settings
API Credentials
- Application ID - Algolia app ID
- Search-Only API Key - Public search key
- Admin API Key - Private indexing key
Indexing
- Indices - Which content to index (products, posts, pages)
- Searchable Attributes - Which fields to search
- Custom Ranking - Relevance ordering
- Synonyms - Configure word equivalents
Autocomplete
- Max Suggestions - Number of results in dropdown
- Powered By - Display Algolia branding
- Customize Templates - HTML/JS templates
InstantSearch
- Enable - Turn on instant search
- Customize - Layout, styling, filters
- Facets - Available filters
Usage
Autocomplete
Replace default WordPress search with Algolia autocomplete:
<?php echo do_shortcode('[algolia_autocomplete]'); ?>
Or use Elementor widget: algolia-autocomplete
InstantSearch
Display instant search results:
<?php echo do_shortcode('[algolia_instantsearch]'); ?>
Or use Elementor widget: algolia-instantsearch
JavaScript API
// Custom autocomplete sources
wp.algolia.autocomplete.sources.push({
source: function(query, callback) {
// Custom source logic
}
});
// InstantSearch configuration
wp.algolia.instantsearch.config = {
// Custom config
};
Indexing
Manual Indexing
Admin Location: Algolia Search → Indexing
Click "Re-index" for each index.
Automatic Indexing
Plugin automatically indexes when:
- Posts/products created or updated
- Content deleted
- Bulk operations
WP-CLI Commands
# Re-index all
wp algolia reindex
# Index specific content type
wp algolia reindex --indices=posts
# Clear index
wp algolia clear
Integration with BigCommerce
Algolia indexes BigCommerce products:
- Product title
- Product description
- SKU
- Brand
- Categories
- Price
- Custom fields
Searchable Attributes (configured in Algolia dashboard):
post_titlecontenttaxonomies.bigcommerce_brandtaxonomies.bigcommerce_categorymeta.sku
Search Page
Default WordPress Search: Replaced with Algolia InstantSearch
Template: search.php or custom template
Features:
- Instant results as you type
- Faceted filters (brand, category, price)
- Pagination
- Result count
- Sorting options
Autocomplete Customization
Template Location: Theme or plugin override
Customize HTML/CSS for autocomplete dropdown:
- Suggestion templates
- Section headers
- Powered by Algolia logo
- Keyboard navigation
Synonyms
Algolia Dashboard: Configure synonyms for better results
Examples:
bow sight⇔bowsightrange finder⇔rangefindersight pins⇔pins
Analytics
Algolia Dashboard: View search analytics
Metrics:
- Top searches
- No results searches
- Click-through rate
- Conversion rate
Search Strategy Comparison
When to Use FacetWP
✅ Use FacetWP for:
- Product catalog/category pages
- Faceted filtering (brand, price, features)
- Complex attribute combinations
- Known category browsing
- Visual product exploration
When to Use Algolia
✅ Use Algolia for:
- Site-wide search
- Search bar autocomplete
- Typo-tolerant search
- Synonym support
- Fast results (hosted service)
- Analytics and insights
Using Both Together
Recommended Setup:
- Homepage/Header: Algolia autocomplete search
- Category Pages: FacetWP faceted filtering
- Search Results Page: Algolia InstantSearch
- Product Catalogs: FacetWP with category navigation
Both can coexist without conflict as they target different use cases.
Performance Considerations
FacetWP Performance
Optimization Tips:
- Enable FacetWP Cache add-on
- Limit number of facets on page
- Use efficient facet types (avoid slider for large ranges)
- Index only necessary data
- Preload queries with
facetwp_preload_force_query
Caching:
- FacetWP Cache add-on (installed)
- Page caching (exclude FacetWP URLs)
- Object caching (Redis/Memcached)
Algolia Performance
Built-in Speed:
- Algolia is hosted service (fast by design)
- CDN distribution
- Optimized indexing
- Real-time updates
Optimization Tips:
- Limit searchable attributes
- Use custom ranking appropriately
- Index only published content
- Configure typo tolerance levels
- Use distinct for duplicate prevention
Troubleshooting
FacetWP Issues
Facets Not Updating
- Check FacetWP indexing complete
- Verify facet data source correct
- Clear FacetWP cache
- Check for JavaScript errors
- Ensure AJAX requests succeeding
Slow Performance
- Enable FacetWP Cache
- Reduce number of facets
- Optimize database queries
- Check server resources
- Review facet configuration
No Results Displaying
- Verify template query correct
- Check post type and taxonomy settings
- Review indexed data
- Check facet selections are valid
- Test without any facets selected
Algolia Issues
Search Not Working
- Verify API credentials correct
- Check indices exist in Algolia dashboard
- Ensure content indexed
- Review searchable attributes
- Check for JavaScript errors
Autocomplete Not Showing
- Verify autocomplete enabled
- Check search input has correct attributes
- Ensure Algolia scripts loaded
- Review browser console for errors
- Test with default theme
Index Out of Sync
- Re-index content manually
- Check automatic indexing enabled
- Review indexing log for errors
- Verify API credentials have write access
- Clear and rebuild indices
Related Documentation
- BigCommerce Integration - Product data source
- Theme System - Widget implementations
- Custom Plugins - Suma Patches Algolia customizations