Machine learning is commonly used to improve ranked retrieval systems. Due to computational diﬃculties, few learning techniques have been developed to directly optimize for mean average precision (MAP), despite its widespread use in evaluating such systems. Existing approaches optimizing MAP either do not ﬁnd a globally optimal solution, or are computationally expensive. In contrast, we present a general SVM learning algorithm that eﬃciently ﬁnds a globally optimal solution to a straightforward relaxation of MAP. We evaluate our approach using the TREC 9 and TREC 10 Web Track corpora (WT10g), comparing against SVMs optimized for accuracy and ROCArea. In most cases we show our method to produce statistically signiﬁcant improvements in MAP scores.