Commit f375a3956817b2cad74a22664bb57acfbdf18d3d
1 parent
aa41bc26
Exists in
master
and in
28 other branches
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,6 +619,9 @@ class Article < ActiveRecord::Base | ||
619 | def f_category | 619 | def f_category |
620 | self.categories.collect(&:name) | 620 | self.categories.collect(&:name) |
621 | end | 621 | end |
622 | + def name_sort | ||
623 | + name | ||
624 | + end | ||
622 | public | 625 | public |
623 | 626 | ||
624 | acts_as_faceted :fields => { | 627 | acts_as_faceted :fields => { |
@@ -631,7 +634,7 @@ class Article < ActiveRecord::Base | @@ -631,7 +634,7 @@ class Article < ActiveRecord::Base | ||
631 | :category_query => proc { |c| "f_category:\"#{c.name}\"" }, | 634 | :category_query => proc { |c| "f_category:\"#{c.name}\"" }, |
632 | :order => [:f_type, :f_published_at, :f_profile_type, :f_category] | 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 | :exclude_fields => [:setting], | 638 | :exclude_fields => [:setting], |
636 | :include => [:profile], | 639 | :include => [:profile], |
637 | :facets => facets_option_for_solr, | 640 | :facets => facets_option_for_solr, |
app/models/profile.rb
@@ -848,6 +848,9 @@ private :generate_url, :url_options | @@ -848,6 +848,9 @@ private :generate_url, :url_options | ||
848 | 'BscPlugin::Bsc' => _('BSC') | 848 | 'BscPlugin::Bsc' => _('BSC') |
849 | }[id] | 849 | }[id] |
850 | end | 850 | end |
851 | + def name_sort | ||
852 | + name | ||
853 | + end | ||
851 | public | 854 | public |
852 | 855 | ||
853 | acts_as_faceted :fields => { | 856 | acts_as_faceted :fields => { |
@@ -858,7 +861,7 @@ private :generate_url, :url_options | @@ -858,7 +861,7 @@ private :generate_url, :url_options | ||
858 | :order => [:f_type, :f_categories] | 861 | :order => [:f_type, :f_categories] |
859 | 862 | ||
860 | acts_as_searchable :additional_fields => [ | 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 | :boost => proc {|p| 10 if p.enabled}, | 865 | :boost => proc {|p| 10 if p.enabled}, |
863 | :facets => facets.keys | 866 | :facets => facets.keys |
864 | 867 |