1. A method of determining a relevance function, comprising: determining one or more features to be used as predictor variables in the construction of a relevance function using at least one processor; parameterizing the relevance function by one or more coefficients; defining a query error that measures, for a given query, a difference between a ranking generated by the relevance function and a ranking based on a training set, the defined query error being a continuous function of coefficients, wherein said defining comprises defining the query error as a difference between an optimal discounted cumulative gain (DCG) function and an approximated version of a DCG; and determining values for the coefficients of the relevance function that substantially minimize an objective function that depends on the defined query error.