Commit 5ff0efc1c95178863e3b4038dc44634907a5c37a
Committed by
Arthur Esposte
1 parent
d14f0ea0
Exists in
master
and in
5 other branches
Fix the ext search controller. Now it uses the full_text_search from the
core Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Conflicts: lib/ext/search_controller.rb
Showing
1 changed file
with
11 additions
and
5 deletions
Show diff stats
lib/ext/search_controller.rb
... | ... | @@ -3,9 +3,11 @@ require_dependency 'search_controller' |
3 | 3 | class SearchController |
4 | 4 | |
5 | 5 | def communities |
6 | - results = filter_communities_list do |community| | |
7 | - !community.software? | |
8 | - end | |
6 | + @scope = visible_profiles(Community) | |
7 | + full_text_search | |
8 | + results = @searches[@asset][:results] | |
9 | + | |
10 | + results = results.each {|community| !community.software?} | |
9 | 11 | results = results.paginate(:per_page => 24, :page => params[:page]) |
10 | 12 | @searches[@asset] = {:results => results} |
11 | 13 | @search = results |
... | ... | @@ -13,11 +15,15 @@ class SearchController |
13 | 15 | |
14 | 16 | def software_infos |
15 | 17 | prepare_software_search_page |
16 | - results = filter_software_infos_list | |
18 | + @scope = visible_profiles(Community) | |
19 | + full_text_search | |
20 | + results = @searches[@asset][:results] | |
21 | + | |
22 | + results = results.select {|community| community if community.software?} | |
17 | 23 | results = results.paginate(:per_page => @per_page, :page => params[:page]) |
18 | 24 | @searches[@asset] = {:results => results} |
19 | 25 | @search = results |
20 | - @software_count = filter_software_infos_list.count | |
26 | + @software_count = results.count | |
21 | 27 | render :layout=>false if request.xhr? |
22 | 28 | end |
23 | 29 | ... | ... |