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 bobsolr <xb...@hotmail.com> on 2011/09/07 08:17:36 UTC

Sorting groups by numFound group size

Hi,

I'm using this sample query to group the result set by category:

q=test&group=true&group.field=category

This works as expected and I get this sample response:

"response":
{"numFound":1,"start":0,"docs":[
      {
       ...
  }
{"numFound":6,"start":0,"docs":[
      {
       ...
  }
{"numFound":3,"start":0,"docs":[
      {
       ...
  }

However, I can't find a way to specify the sort order of the groups by
number of docs each group has ("numFound field). I think the "sort" param
has something to do with it, but I don't know how to use it.

Any help will be greatly appreciated!

--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3315740.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting groups by numFound group size

Posted by Martijn v Groningen <ma...@gmail.com>.
Not yet. If you want you can create an issue for sorting groups by numFound.

On 9 September 2011 18:49, O. Klein <kl...@octoweb.nl> wrote:

> I am also looking for way to sort on numFound.
>
> Has an issue been created?
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3323420.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Met vriendelijke groet,

Martijn van Groningen

Re: Sorting groups by numFound group size

Posted by "O. Klein" <kl...@octoweb.nl>.
I am also looking for way to sort on numFound.

Has an issue been created?

--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3323420.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting groups by numFound group size

Posted by Martijn v Groningen <ma...@gmail.com>.
No, as far as I know sorting by group count isn't planned. You can create an
issue in Jira where future development of this feature can be tracked.

On 7 September 2011 23:54, bobsolr <xb...@hotmail.com> wrote:

> Hi Martijn,
>
> Thanks for the reply. Unfortunately I can't reference the group size using
> a
> function or by specifying a schema field, although I use those methods to
> sort docs within a group. Do you know if sort by group size is
> available/planned for a future release of solr(maybe 4.0)? if so, it might
> be worth a shot do get a trunk version to try that. btw, I'm using 3.3 now.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3318060.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Met vriendelijke groet,

Martijn van Groningen

Re: Sorting groups by numFound group size

Posted by bobsolr <xb...@hotmail.com>.
Hi Martijn,

Thanks for the reply. Unfortunately I can't reference the group size using a
function or by specifying a schema field, although I use those methods to
sort docs within a group. Do you know if sort by group size is
available/planned for a future release of solr(maybe 4.0)? if so, it might
be worth a shot do get a trunk version to try that. btw, I'm using 3.3 now.

--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3318060.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting groups by numFound group size

Posted by Martijn v Groningen <ma...@gmail.com>.
Sorting groups by numfound isn't possible. You can sort groups by specifying
a function or a field (from your schema) in the sort parameter.
The numFound isn't a field so that is why you can't sort on it.

Martijn

On 7 September 2011 08:17, bobsolr <xb...@hotmail.com> wrote:

> Hi,
>
> I'm using this sample query to group the result set by category:
>
> q=test&group=true&group.field=category
>
> This works as expected and I get this sample response:
>
> "response":
> {"numFound":1,"start":0,"docs":[
>      {
>       ...
>  }
> {"numFound":6,"start":0,"docs":[
>      {
>       ...
>  }
> {"numFound":3,"start":0,"docs":[
>      {
>       ...
>  }
>
> However, I can't find a way to specify the sort order of the groups by
> number of docs each group has ("numFound field). I think the "sort" param
> has something to do with it, but I don't know how to use it.
>
> Any help will be greatly appreciated!
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Sorting-groups-by-numFound-group-size-tp3315740p3315740.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Met vriendelijke groet,

Martijn van Groningen