Commit 6d1b6d1e6bb3357e41d4d92db611285668593a56

Authored by AntonioTerceiro
1 parent 4064acf8

ActionItem25: don't search by tag; instead, index the tags so they are searched …

…indirectly and we don't have abnormal "relevancies"



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1048 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/public/search_controller.rb
@@ -13,10 +13,6 @@ class SearchController < ApplicationController @@ -13,10 +13,6 @@ class SearchController < ApplicationController
13 ############################################# 13 #############################################
14 14
15 search do |query| 15 search do |query|
16 - Article.find_tagged_with(query)  
17 - end  
18 -  
19 - search do |query|  
20 Article.find_by_contents(query) 16 Article.find_by_contents(query)
21 end 17 end
22 18
app/models/article.rb
@@ -14,7 +14,7 @@ class Article < ActiveRecord::Base @@ -14,7 +14,7 @@ class Article < ActiveRecord::Base
14 14
15 acts_as_versioned 15 acts_as_versioned
16 16
17 - acts_as_searchable :fields => [ :name, :abstract, :body ] 17 + acts_as_searchable :fields => [ :name, :abstract, :body, :tag_list ]
18 18
19 # retrieves all articles belonging to the given +profile+ that are not 19 # retrieves all articles belonging to the given +profile+ that are not
20 # sub-articles of any other article. 20 # sub-articles of any other article.