This paper proposes a discriminative model for the retrieval of images from text queries. Contrary to previous research, this approach does not rely on an intermediate annotation task. Instead, it addresses the retrieval problem directly, and learns from a criterion related to the final ranking performance of the retrieval model. Moreover, our learning procedure builds upon recent work on the online learning of kernel-based classifiers, yielding an efficient, scalable training algorithm. The experiments performed over stock photography data show the advantage of our discriminative ranking approach over state-of-the-art alternatives (e.g. our model yields $26.3\%$ average precision over the standard Corel benchmark, which should be compared to $22.0\%$, for the best alternative model evaluated).