How to Sort Apache Solr Results in Random Order

Usually, when running a query, the goal is to obtain a set of documents in descending order of relevance.

May sound unusual, but sometimes it is necessary to obtain a set of documents randomly sorted, regardless of their relevance. For example, retrieving some documents to generate a dataset for the fine-tuning of a language model.

Let's see how this is possible in Apache Solr - the complete post can be read here: How to Sort Apache Solr Results in Random Order