Calculate stats when the search is run