return new RedirectView(hit.getPermalink());
} else {
// show all results on the search results page
String sort = request.getParameter("sort");
if (sort != null && sort.equalsIgnoreCase("date")) {
results.sortByDateDescending();
} else {
results.sortByScoreDescending();
}
Pageable pageable = new Pageable(results.getHits());