Spree Search with Description
This extension enhances Spree Commerce search functionality to include product descriptions in search queries.
Features
- Extends product search to include product descriptions
- Supports multi-language search through product translations
- Maintains compatibility with existing search features (price filters, sorting, etc.)
- Optimized single SQL query for all search conditions
Installation
Add this line to your application's Gemfile:
gem 'spree_search_with_description', path: 'engines/spree_search_with_description'
And then execute:
bundle install
Usage
Once installed, the extension automatically enhances the search functionality. Users can now search for products using:
- Product names
- Product descriptions (including translated versions)
- SKUs
- All existing search filters continue to work
Technical Details
The extension works by:
- Replacing the default
Spree::Products::Findfinder withSpree::ProductsWithDescriptionFinder - Extending the
by_querymethod to include description fields in the search - Supporting both main product table and translation table descriptions
- Maintaining all existing search functionality (filters, sorting, etc.)
Development
This extension follows standard Spree extension patterns and integrates seamlessly with the existing search infrastructure.