mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 11:58:00 +08:00
Search Refactor: Let's use a class to keep track of our state rather
than passing params everywhere. Also make the private API private.
This commit is contained in:
@ -3,8 +3,11 @@ require_dependency 'search'
|
||||
class SearchController < ApplicationController
|
||||
|
||||
def query
|
||||
search_result = Search.query(params[:term], guardian, params[:type_filter], SiteSetting.min_search_term_length)
|
||||
render_json_dump(search_result.as_json)
|
||||
search = Search.new(params[:term],
|
||||
guardian: guardian,
|
||||
type_filter: params[:type_filter])
|
||||
|
||||
render_json_dump(search.execute.as_json)
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user