Skip to content

Add Elasticsearch goodies to Spree, powered by searchkick

License

Notifications You must be signed in to change notification settings

shubham-kaushal/spree_searchkick

 
 

Repository files navigation

Spree + Searchkick

Build Status

Add Elasticsearch goodies to Spree, powered by searchkick

Features

  • Full search (keyword, in_taxon)
  • Taxons Aggregations (aggs)
  • Search Autocomplete endpoint (/autocomplete/products?keywords=example)
  • Added /best route, where best selling products are boosted in first page

Installation

Add searchkick and spree_searchkick to your Gemfile:

gem 'searchkick'
gem 'spree_searchkick', github: 'spree-contrib/spree_searchkick'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_searchkick:install
bundle exec rails searchkick:reindex:all

Install elasticsearch

Documentation

By default, only the Spree::Product class is indexed and to control what data is indexed, override Spree::Product#search_data method. Call Spree::Product.reindex after changing this method.

To enable or disable taxons filters, go to taxonomy form and change filterable boolean.

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_searchkick/factories'

Copyright (c) 2015-2020 Gonzalo Moreno & other contributors, released under the New BSD License

About

Add Elasticsearch goodies to Spree, powered by searchkick

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 96.1%
  • HTML 3.9%