changes search results to nest results in an array that also contains a total result count