Is there a way in solr to get results according to some distribution of one of the indexed fields?
For example, imagine I have a catalog of books with fields synopsis, publication_year and genre.
I would like to build a query that returns the most relevant results according to synopsis favoring the most recently published books. However, in the final results (let's say 1000) I would like the genre to be distributed as closely as possible according to some given distribution. For example: 50% Science-Fiction, 25% Non-Fiction, 10% Politics and so on..
I know I could get a large result set and do some sort of weighted reservoir sampling to get the final 1000 books outside solr, but I am looking for a solution that would be solr only.
Is this possible and if yes, how?