summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authormo k <m@mokhan.ca>2011-12-15 21:13:22 -0700
committermo k <m@mokhan.ca>2011-12-15 21:13:22 -0700
commit072fb968cea6ee4dc65fe254f359472b4b64420f (patch)
tree3690706239dbdcfe4e7ec71c18fa491491cbc588 /app/controllers/search_controller.rb
parent93f31928873bf3b0c68e4543eba4cf94849d09ee (diff)
switch from sphinx search to straight sql search.
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index a52b34a2..885acb82 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -1,6 +1,8 @@
class SearchController < ApplicationController
def index
- @creations = Creation.search(params[:q], :include => :user, :match_mode => :extended, :star => true).page(params[:page]).per(6)
+ sql = "%"+params[:q]+"%"
+ @creations = Creation.where("name like ? OR story like ?", sql, sql).page(params[:page]).per(6)
+ # @creations = Creation.search(params[:q], :include => :user, :match_mode => :extended, :star => true).page(params[:page]).per(6)
@search = params[:q]
end
end