Permalink
Browse files

主搜索的 Topic, User 改用 complete 方式搜索;

  • Loading branch information...
1 parent df4acbf commit c10b2c16a0a8a59a60ee4bc2622e91a8cd92322b @huacnlee committed Aug 16, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/search_controller.rb
@@ -8,9 +8,9 @@ def index
end
def all
- result = RedisSearch::Search.query("Topic",params[:q].strip,:limit => 10)
+ result = RedisSearch::Search.complete("Topic",params[:q].strip,:limit => 10)
if result.length < 10
- result += RedisSearch::Search.query("User",params[:q].strip,:limit => 10)
+ result += RedisSearch::Search.complete("User",params[:q].strip,:limit => 10)
if result.length < 10
result += RedisSearch::Search.query("Ask",params[:q].strip,:limit => 10)
end

0 comments on commit c10b2c1

Please sign in to comment.