Luis,

I am presuming you do not have an overarching grouping value here…and simply 
wish to show a standard search result that shows 1 item per company.

You should be able to accomplish your second page of desired items (the second 
item from each of your 20 represented companies) by using the group.offset 
parameter.  This will shift the position in the returned array of documents to 
the value provided.

Thus:

group.limit=1&group.field=companyid&group.offset=1

…would return the second item in each companyid group matching your current 
query.

Jason

On May 9, 2013, at 10:30 AM, Luis Carlos Guerrero Covo 
<lcguerreroc...@gmail.com> wrote:

> Hi,
> 
> I'm using solr to maintain an index of items that belong to different
> companies. I want the search results to be returned in a way that is fair
> to all companies, thus I wish to group the results such that each company
> has 1 item in each group, and the groups of results should be returned
> sorted by score.
> 
> example:
> ----------------------
> 
> 20 companies
> 
> first 100 results
> 
> 1-20 results - (company1 highest score item, company2 highest score item,
> etc..)
> 20-40 results - (company1 second highest score item, company 2 second
> highest score item, etc..)
> ...
> 
> ----------------------
> 
> I'm trying to use the field collapsing feature but I have only been able to
> create the first group of results by using
> group.limit=1,group.field=companyid. If I raise the group.limit value, I
> would be violating the 'fairness rule' because more than one result of a
> company would be returned in the first group of results.
> 
> Can I achieve the desired search result using SOLR, or do I have to look at
> other options?
> 
> thank you,
> 
> Luis Guerrero

Reply via email to