rank_results function

Rank the results by a metric