public function sortSearchResults($results, $term)
    {
        $sortedResults = [];

        if (!empty($results)) {
            foreach ($results as $result) {
                if (stripos($result->getTitle(), $term) !== false) {
                    array_unshift($sortedResults, $result);
                } else {
                    $sortedResults[] = $result;
                }
            }
        }

        return $sortedResults;
    }