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:

  1. Replacing the default Spree::Products::Find finder with Spree::ProductsWithDescriptionFinder
  2. Extending the by_query method to include description fields in the search
  3. Supporting both main product table and translation table descriptions
  4. Maintaining all existing search functionality (filters, sorting, etc.)

Development

This extension follows standard Spree extension patterns and integrates seamlessly with the existing search infrastructure.