There's no great way to do that.
One approach would be using facets, but that will just get you the
author names (as stored in fields), and not the documents under it. If
you really only want to show the author names, facets could work. One
issue with facets though is Solr won't tell you the total number of
facet values for your query, so it's tricky to provide next/prev paging
through them.
There is also a 'field collapsing' feature that I think is not in a
released Solr, but may be in the Solr repo. I'm not sure it will quite
do what you want either though, although it's related and worth a look.
http://wiki.apache.org/solr/FieldCollapsing
Another vaguely related thing that is also not yet in a released Solr,
is a 'join' function. That could possibly be used to do what you want,
although it'd be tricky too. https://issues.apache.org/jira/browse/SOLR-2272
Jonathan
On 6/1/2011 2:56 PM, beccax wrote:
Apologize if this question has already been raised. I tried searching but
couldn't find the relevant posts.
We've indexed a bunch of documents by different authors. Then for search
results, we'd like to show the authors that have 1 or more documents
matching the search keywords.
The problem is right now our solr search method first paginates results to
100 documents per page, then we take the results and group by authors. This
results in different number of authors per page. (Some authors may only
have one matching document and others 5 or 10.)
How do we change it to somehow show the same number of authors (say 25) per
page?
I mean alternatively we could just show all the documents themselves ordered
by author, but it's not the user experience we're looking for.
Thanks so much. And please let me know if you need more details not
provided here.
B
--
View this message in context:
http://lucene.472066.n3.nabble.com/Newbie-question-how-to-deal-with-different-of-search-results-per-page-due-to-pagination-then-grouping-tp3012168p3012168.html
Sent from the Solr - User mailing list archive at Nabble.com.