Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Documentation production server config

  • Loading branch information...
commit 9beb9802b0f26e721652477b20bf9ff369cfe263 1 parent 21db50f
@iloveitaly authored
Showing with 35 additions and 11 deletions.
  1. +35 −10
  2. +0 −1  app/views/spree/products/_sort_bar.html.erb
@@ -1,13 +1,13 @@
-Adds Solr search to Spree using [Sunspot](
+Adds Solr search to Spree Commerce using [Sunspot](
This is compatible with Spree 1.1.x. Untested on 1.0, but will probably work without too much modification.
Add spree_sunspot_search to your Gemfile and run bundler.
@@ -28,23 +28,47 @@ Copy the initializer and add `solr_sort_by` to `all.js`:
`rails g spree_sunspot_search:install`
+Running & Indexing
Start up Solr (bundled with Sunspot's install)
-`rake sunspot:solr:run`
+`bundle exec rake sunspot:solr:run`
Build the index for the first time
-`rake sunspot:reindex`
+`bundle exec rake sunspot:reindex`
Stop the solr process:
-`rake sunspot:solr:stop`
+`bundle exec rake sunspot:solr:stop`
+Production Server
+To configure development / production solr server edit `$RAILS_ROOT/config/solr.yml`.
+Read the [sunspot documentation](
+and [this great post]( for more information about production configuration.
+Below is a sample config for production that works well for a site with relatively low search traffic and capistrano based deployment:
+ production:
+ solr:
+ hostname:
+ bind_address:
+ port: 8983
+ log_level: WARNING
+ max_memory: 100M
+ data_path: /data/spree/shared/solr/data
+ pid_dir: /data/spree/shared/solr/pids
+ solr_home: /data/spree/shared/solr
+ auto_commit_after_request: false
-Customize the Facets Shown
Edit the [initializer]( created by the installation script.
The initializer template should provide enough examples to get you started.
@@ -56,6 +80,7 @@ TODO
* Sorting by facet criteria and Solr analytics (Best result, Popular, etc.)
* Open the Sunspot DSL to utilise all the additional data and analytics available through Solr
* Get the Taxon browsing (e.g. Categories) to utilise the Solr data for speed boosts
+* Testing via + rspec
1  app/views/spree/products/_sort_bar.html.erb
@@ -5,7 +5,6 @@ if not params.keys.detect { |k| k != 'controller' and k != 'action' }.nil? and p
options = do |key, value|
# value is sort direction
value = [value] if !value.is_a? Array
- "Array Key sort.#{key}_#{value}" { |sort| [t("sort.#{key}_#{sort}"), url_for(request.params.merge({:sort => key, :order => sort}))] }
Please sign in to comment.
Something went wrong with that request. Please try again.