Field Collapsing - sort by group count, get total groups

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Field Collapsing - sort by group count, get total groups

ssetem
Hi,

I wondered if it is possible to sort groups by the total within the group, and to bring back total amount of groups?

Trying to build reporting system, which shows highest aggregates first, then allows pagination through this list.

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Field Collapsing - sort by group count, get total groups

Yonik Seeley-2-2
On Tue, Dec 7, 2010 at 7:03 AM, ssetem <[hidden email]> wrote:
> I wondered if it is possible to sort groups by the total within the group,
> and to bring back total amount groups?

That is planned, but not currently implemented.
You can use faceting to get both totals and sort by highest total though.

Total number of groups is a different problem - we don't return it
because we don't know.
It will take a different algorithm (that's more memory intensive) to
find out the total number of groups.
If the number is unlikely to be too large, you could just return all
groups (or use faceting to do that more efficiently).

-Yonik
http://www.lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

Re: Field Collapsing - sort by group count, get total groups

ssetem
Thanks for the reply,

How would i get the total amount of possible facets(non zero) to allow pagination through facets, I've searched around but have not found a solution yet.

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Field Collapsing - sort by group count, get total groups

Yonik Seeley-2-2
On Tue, Dec 7, 2010 at 9:07 AM, ssetem <[hidden email]> wrote:
> Thanks for the reply,
>
> How would i get the total amount of possible facets(non zero), I've searched
> around but have no luck.

Only current way would be to request them all.

Just like field collapsing, this is a number we don't (generally)
have.  There are optimizations like short-circuiting on the docfreq
that would need to be disabled to generate that count.

-Yonik
http://www.lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

Re: Field Collapsing - sort by group count, get total groups

ssetem
This post has NOT been accepted by the mailing list yet.
Cheers for the reply, I'll give that a go.
Reply | Threaded
Open this post in threaded view
|

Re: Field Collapsing - sort by group count, get total groups

ssetem
This post has NOT been accepted by the mailing list yet.
In reply to this post by Yonik Seeley-2-2
Hi,

Managed to get total count of facets/ groups.

Luckily i field collapse/ facet on an integer so i can apply a facet query to get the count back
like &facet.query=itemId:[0 TO 10000000]

Just need group sorting, but i'l use facets for now and fill in the extra data with a second search.

**edit** actual scratch that, i dont think works after all :S:P

Cheers for all the help.