cirandas.net

ref: master

plugins/solr/lib/ext/enterprise.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require_dependency 'enterprise'
require_dependency "#{File.dirname __FILE__}/profile"

ActiveSupport.run_load_hooks :solr_enterprise

class Enterprise

  SEARCH_FILTERS[:order] = []

  after_save_reindex [:products], with: :delayed_job

  extend SolrPlugin::ActsAsSearchable
  solr_extra_data_for_index :solr_product_categories_names

  def solr_product_categories_names
    self.product_categories.map(&:name).uniq
  end

end