diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-02-17 20:20:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-02-17 20:20:51 +0000 |
commit | 74e85953f00f07141a0226ad951646279765a9f5 (patch) | |
tree | 9644cafeb5891b88c06ef416263f9cd11707ffbd /app/controllers/search_controller.rb | |
parent | c11d30ebc9f50abf476779e046ba1792453a585d (diff) | |
download | redmine-74e85953f00f07141a0226ad951646279765a9f5.tar.gz redmine-74e85953f00f07141a0226ad951646279765a9f5.zip |
Move SQL LIKE tokens to acts_as_searchable.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3445 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index eae38016f..0f0a4e6ae 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -67,16 +67,14 @@ class SearchController < ApplicationController if !@tokens.empty? # no more than 5 tokens to search for - @tokens.slice! 5..-1 if @tokens.size > 5 - # strings used in sql like statement - like_tokens = @tokens.collect {|w| "%#{w.downcase}%"} + @tokens.slice! 5..-1 if @tokens.size > 5 @results = [] @results_by_type = Hash.new {|h,k| h[k] = 0} limit = 10 @scope.each do |s| - r, c = s.singularize.camelcase.constantize.search(like_tokens, projects_to_search, + r, c = s.singularize.camelcase.constantize.search(@tokens, projects_to_search, :all_words => @all_words, :titles_only => @titles_only, :limit => (limit+1), |