We are using Solr 1.4 to produce results for user queries. The results are fetched from an index containing approximately 500k documents. The index is constantly being updated with new documents and old documents expire.
The results pages are lists of documents sorted by relevancy (score), automatically calculated by solr depending on the user's query. Each document belongs to a single category (e.g engineering, finance, administration, maths etc) and the category id is stored and indexed by Solr.
What we want to achieve is for documents to be sorted on relevancy, but also be weighted in some way so that at least the first page of results (10,20 or 50) contains documents from as many categories as possible and as few documents of the same category are consecutive.
We've searched a lot but have not managed to come up with any feasible scenario.
Many thanks in advance for any ideas. GK