Commit f375a3956817b2cad74a22664bb57acfbdf18d3d

Authored by Braulio Bhavamitra
1 parent aa41bc26

Name was not being found by Solr

Showing 2 changed files with 8 additions and 2 deletions   Show diff stats
app/models/article.rb
... ... @@ -619,6 +619,9 @@ class Article < ActiveRecord::Base
619 619 def f_category
620 620 self.categories.collect(&:name)
621 621 end
  622 + def name_sort
  623 + name
  624 + end
622 625 public
623 626  
624 627 acts_as_faceted :fields => {
... ... @@ -631,7 +634,7 @@ class Article < ActiveRecord::Base
631 634 :category_query => proc { |c| "f_category:\"#{c.name}\"" },
632 635 :order => [:f_type, :f_published_at, :f_profile_type, :f_category]
633 636  
634   - acts_as_searchable :additional_fields => [ {:name => {:type => :string, :as => :name_sort, :boost => 5.0}} ] + facets_fields_for_solr,
  637 + acts_as_searchable :additional_fields => [ {:name => {:type => :string}} ] + facets_fields_for_solr,
635 638 :exclude_fields => [:setting],
636 639 :include => [:profile],
637 640 :facets => facets_option_for_solr,
... ...
app/models/profile.rb
... ... @@ -848,6 +848,9 @@ private :generate_url, :url_options
848 848 'BscPlugin::Bsc' => _('BSC')
849 849 }[id]
850 850 end
  851 + def name_sort
  852 + name
  853 + end
851 854 public
852 855  
853 856 acts_as_faceted :fields => {
... ... @@ -858,7 +861,7 @@ private :generate_url, :url_options
858 861 :order => [:f_type, :f_categories]
859 862  
860 863 acts_as_searchable :additional_fields => [
861   - :extra_data_for_index, {:name => {:type => :string, :as => :name_sort, :boost => 5.0}} ] + facets.keys.map{|i| {i => :facet}},
  864 + :extra_data_for_index, {:name_sort => {:type => :string}} ] + facets.keys.map{|i| {i => :facet}},
862 865 :boost => proc {|p| 10 if p.enabled},
863 866 :facets => facets.keys
864 867  
... ...