Our search engine has become quite powerful. Previously, we used Lucene for the fast retrieval of documents and then used a machine learning model for reordering them. By doing this, we were solving a ranking problem. After being given a query and a collection of documents, we need to order all the documents such that the ones that are the most relevant to the query have the highest rank.
Previously, we approached this problem as a classification: we built a binary classification model to separate relevant and non-relevant documents, and we used the probability of a document being relevant for sorting. This approach works reasonably well in practice, but has a limitation: it only considers one element at a time ...