diff --git a/plugins/solr/lib/ext/article.rb b/plugins/solr/lib/ext/article.rb index 795d859..3968b76 100644 --- a/plugins/solr/lib/ext/article.rb +++ b/plugins/solr/lib/ext/article.rb @@ -2,8 +2,6 @@ require_dependency 'article' class Article - handle_asynchronously :solr_save - acts_as_faceted :fields => { :solr_plugin_f_type => {:label => _('Type'), :proc => proc{|klass| solr_plugin_f_type_proc(klass)}}, :solr_plugin_f_published_at => {:type => :date, :label => _('Published date'), :queries => {'[* TO NOW-1YEARS/DAY]' => _("Older than one year"), @@ -34,6 +32,8 @@ class Article :boost => proc { |a| 10 if a.profile && a.profile.enabled }, :if => proc{ |a| ! ['RssFeed'].include?(a.class.name) } + handle_asynchronously :solr_save + def solr_plugin_comments_updated solr_save end diff --git a/plugins/solr/lib/ext/category.rb b/plugins/solr/lib/ext/category.rb index 8cc54ee..cb131dd 100644 --- a/plugins/solr/lib/ext/category.rb +++ b/plugins/solr/lib/ext/category.rb @@ -2,7 +2,6 @@ require_dependency 'category' class Category after_save_reindex [:articles, :profiles], :with => :delayed_job - handle_asynchronously :solr_save acts_as_searchable :fields => [ # searched fields @@ -15,6 +14,8 @@ class Category {:solr_plugin_name_sortable => :string}, ] + handle_asynchronously :solr_save + private def solr_plugin_name_sortable diff --git a/plugins/solr/lib/ext/product.rb b/plugins/solr/lib/ext/product.rb index f373b19..d33ee21 100644 --- a/plugins/solr/lib/ext/product.rb +++ b/plugins/solr/lib/ext/product.rb @@ -2,7 +2,6 @@ require_dependency 'product' class Product after_save_reindex [:enterprise], :with => :delayed_job - handle_asynchronously :solr_save acts_as_faceted :fields => { :solr_plugin_f_category => {:label => _('Related products')}, @@ -43,6 +42,8 @@ class Product ], :facets => facets_option_for_solr, :boost => proc{ |p| boost = 1; SolrPlugin::Boosts.each{ |b| boost = boost * (1 - ((1 - b[2].call(p)) * b[1])) }; boost} + handle_asynchronously :solr_save + private def solr_plugin_f_category diff --git a/plugins/solr/lib/ext/profile.rb b/plugins/solr/lib/ext/profile.rb index 060f3ab..104b2b8 100644 --- a/plugins/solr/lib/ext/profile.rb +++ b/plugins/solr/lib/ext/profile.rb @@ -2,7 +2,6 @@ require_dependency 'profile' class Profile after_save_reindex [:articles], :with => :delayed_job - handle_asynchronously :solr_save acts_as_faceted :fields => { :solr_plugin_f_enabled => {:label => _('Situation'), :type_if => proc { |klass| klass.kind_of?(Enterprise) }, @@ -32,6 +31,8 @@ class Profile ], :facets => facets_option_for_solr, :boost => proc{ |p| 10 if p.enabled } + handle_asynchronously :solr_save + class_inheritable_accessor :solr_plugin_extra_index_methods self.solr_plugin_extra_index_methods = [] -- libgit2 0.21.2