fix search results into a format the template can use