src/PHPDish/Bundle/WebBundle/Controller/SearchController.php
protected function searcFrom($keyword, $type, $options)
    {
        $searchService = $this->get('phpdish.searcher');

        if ($type === static::TYPE_TOPIC) {
            $searchResult = $searchService->queryTopics($keyword, $options);
        } elseif ($type === static::TYPE_USER) {
            $searchResult = $searchService->queryUsers($keyword, $options);
        } else {
            $searchResult = $searchService->queryPosts($keyword, $options);
        }

        return $searchResult;
    }
protected function searcFrom($keyword, $type, $options)
    {
        $searchService = $this->get('phpdish.searcher');

        if ($type === static::TYPE_TOPIC) {
            $searchResult = $searchService->queryTopics($keyword, $options);
        } elseif ($type === static::TYPE_USER) {
            $searchResult = $searchService->queryUsers($keyword, $options);
        } else {
            $searchResult = $searchService->queryPosts($keyword, $options);
        }

        return $searchResult;
    }
从搜索服务获取搜索结果

@param string $keyword
@param string $type
@param array $options
@return Pagerfanta