Ranking Measures and Loss Functions in Learning to Rank