You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Bryan Bende <bb...@gmail.com> on 2013/06/25 22:12:54 UTC

Result Grouping

I was reading this documentation on Result Grouping...
http://docs.lucidworks.com/display/solr/Result+Grouping

which says...

sort - sortspec - Specifies how Solr sorts the groups relative to each
other. For example, sort=popularity desc will cause the groups to be sorted
according to the highest popularity document in each group. The default
value is score desc.

group.sort - sort.spec - Specifies how Solr sorts documents within a single
group. The default value is score desc.

Is it possible to use these parameters such that group.sort would first
sort with in each group, and then the overall sort would be applied
according to the first element of each sorted group ?

For example, using the scenario above where it has "sort=popularity desc",
could you also have "group.sort=date asc" resulting in the the most recent
document of each group being sorted by decreasing popularity ?

It seems to work the way I described when running a single node Solr 4.3
instance, but in a 2 shard configuration it appears to work differently.

-Bryan

Re: Result Grouping

Posted by Upayavira <uv...@odoko.co.uk>.
What type of field are you grouping on? What happens when you distribute
it? I.e. what specifically goes wrong?

Upayavira

On Tue, Jun 25, 2013, at 09:12 PM, Bryan Bende wrote:
> I was reading this documentation on Result Grouping...
> http://docs.lucidworks.com/display/solr/Result+Grouping
> 
> which says...
> 
> sort - sortspec - Specifies how Solr sorts the groups relative to each
> other. For example, sort=popularity desc will cause the groups to be
> sorted
> according to the highest popularity document in each group. The default
> value is score desc.
> 
> group.sort - sort.spec - Specifies how Solr sorts documents within a
> single
> group. The default value is score desc.
> 
> Is it possible to use these parameters such that group.sort would first
> sort with in each group, and then the overall sort would be applied
> according to the first element of each sorted group ?
> 
> For example, using the scenario above where it has "sort=popularity
> desc",
> could you also have "group.sort=date asc" resulting in the the most
> recent
> document of each group being sorted by decreasing popularity ?
> 
> It seems to work the way I described when running a single node Solr 4.3
> instance, but in a 2 shard configuration it appears to work differently.
> 
> -Bryan