jbrien/spree_sunspot_search — pull request #8 by romul (2012-12-09 12:07:04+00:00)
Title: Ability to use hits & stored attrs to retrieve products data

Sunspot has support of feature named [stored fields](https://github.com/sunspot/sunspot#stored-fields). It allows avoid queries to db in several cases. So, this feature is easy to implement in spree_sunspot_search and it can be very useful.
Just for example, you can even display list of products (search result) without queries to db:

Spree::Search.configure do |conf|
# ...
conf.fields = [{:type => :text, :name => :name, :opts => {:stored => true}},
{:type => :text, :name => :description, :opts => {:stored => true}},
{:type => :float, :name => :price, :opts => {:stored => true}},
{:type => :text, :name => :meta_keywords, :opts => {:stored => true}},
{:type => :string, :name => :small_image_url, :opts => {:stored => true}},
{:type => :string, :name => :permalink, :opts => {:stored => true}},
{:type => :boolean, :name => :on_display, :opts => {:using => :on_display?, :stored => true}}]
end