Learning multiple metrics for ranking