Commit 2add0a3c60b2faf984f7d18388505c914457b9e2
1 parent
2ed0437e
Exists in
elasticsearch_sort
Fixed noosfero to be support noosfero links
Signed-off-by: Arthur Jahn <stutrzbecher@gmail.com> Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com> Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
1 changed file
with
15 additions
and
3 deletions
Show diff stats
plugins/elasticsearch/lib/elasticsearch_plugin.rb
| @@ -17,12 +17,24 @@ class ElasticsearchPlugin < Noosfero::Plugin | @@ -17,12 +17,24 @@ class ElasticsearchPlugin < Noosfero::Plugin | ||
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | def search_controller_filters | 19 | def search_controller_filters |
| 20 | - block = proc do | ||
| 21 | - redirect_to controller: 'elasticsearch_plugin', action: 'search', params: params | ||
| 22 | - end | 20 | + block = proc do |
| 21 | + | ||
| 22 | + case action_name | ||
| 23 | + when 'contents' | ||
| 24 | + params[:selected_type] = :text_article | ||
| 25 | + when 'index' | ||
| 26 | + when 'articles' | ||
| 27 | + params[:selected_type] = :text_article | ||
| 28 | + else | ||
| 29 | + params[:selected_type] = action_name.singularize.to_sym | ||
| 30 | + end | ||
| 31 | + | ||
| 32 | + redirect_to controller: 'elasticsearch_plugin', action: 'search', params: params | ||
| 33 | + end | ||
| 23 | 34 | ||
| 24 | [{ :type => 'before_filter', | 35 | [{ :type => 'before_filter', |
| 25 | :method_name => 'redirect_search_to_elastic', | 36 | :method_name => 'redirect_search_to_elastic', |
| 26 | :block => block }] | 37 | :block => block }] |
| 27 | end | 38 | end |
| 39 | + | ||
| 28 | end | 40 | end |