refactors Discourse.SearchController
Merge pull request #1884 from velesin/search_controller_refactoring

refactors Discourse.SearchController