refactored out the search query logic from a single controller so that we could add a counting controller. we need quick access to the number of results of specific queries.