cirandas.net

ref: master

plugins/solr/lib/ext/products_plugin/qualifier.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
if defined? ProductsPlugin

require_dependency 'products_plugin/qualifier'

ActiveSupport.run_load_hooks :solr_qualifier

module ProductsPlugin
  class Qualifier

    after_save_reindex [:products], with: :delayed_job

    extend SolrPlugin::ActsAsSearchable

    acts_as_searchable fields: SEARCHABLE_FIELDS.map{ |field, options|
      {field => {boost: options[:weight]}}
    }

  end
end

end