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 Dominique Bejean <do...@eolya.fr> on 2015/03/13 16:24:51 UTC

Facet pivot sorting while combining Stats Component With Pivots in Solr 5

Hi,

Here is a query with a sample result set.

http://localhost:8983/solr/myindex/select?q=*%3A*&wt=json&indent=true&stats=true&stats.field={!tag=piv1}size&facet=true&facet.limit=10&facet.pivot={!stats=piv1}object&rows=0


  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_pivot":{
      "object":[{
          "field":"object",
          "value":"2_supervision",
          "count":76657,
          "stats":{
            "stats_fields":{
              "size":{
                "min":18.0,
                "max":61.0,
                "count":76657,
                "missing":0,
                "sum":4590645.0,
                "sumOfSquares":2.75310789E8,
                "mean":59.88552904496654,
                "stddev":2.277412264831095,
                "facets":{}}}}},
        {
          "field":"object",
          "value":"2_spw-super-010",
          "count":8694,
          "stats":{
            "stats_fields":{
              "size":{
                "min":0.0,
                "max":61.0,
                "count":8694,
                "missing":0,
                "sum":510886.0,
                "sumOfSquares":3.042645E7,
                "mean":58.763054980446285,
                "stddev":6.827549006021397,
                "facets":{}}}}},
        {
          "field":"object",
          "value":"4_10.1.1.100",
          "count":7441,
          "stats":{
            "stats_fields":{
              "size":{
                "min":0.0,
                "max":61.0,
                "count":7441,
                "missing":0,
                "sum":421964.0,
                "sumOfSquares":2.475678E7,
                "mean":56.70796935895713,
                "stddev":10.549794992510861,
                "facets":{}}}}}


Is it possible to sort the facet pivot items by using a stat value like sum
or mean ?

Thank you.

Dominique

Re: Facet pivot sorting while combining Stats Component With Pivots in Solr 5

Posted by Yonik Seeley <ys...@gmail.com>.
On Fri, Mar 13, 2015 at 1:43 PM, Dominique Bejean
<do...@eolya.fr> wrote:
> Thank you for the response
>
> This is something Heliosearch can do. Ionic Seeley, created a JIRA ticket
> to back port this feature to Solr 5.

Oh, I'm charged now, am I?  ;-)

I'ts been committed, and will be in Solr 5.1

Here's an example of sorting the buckets by something other than count:

$ curl http://localhost:8983/solr/query -d 'q=*:*&
 json.facet={
   categories:{
     terms:{
       field : cat,
       sort : "x desc",   // can also use sort:{x:desc}
       facet:{
         x : "avg(price)",
         y : "sum(price)"
       }
     }
   }
 }
'

-Yonik

Re: Facet pivot sorting while combining Stats Component With Pivots in Solr 5

Posted by Dominique Bejean <do...@eolya.fr>.
Thank you for the response

This is something Heliosearch can do. Ionic Seeley, created a JIRA ticket
to back port this feature to Solr 5.
https://issues.apache.org/jira/browse/SOLR-7214
But in order to be available in Solr 5 this ticket should cover both
http://heliosearch.org/json-facet-api/
http://heliosearch.org/solr-facet-functions/
http://heliosearch.org/solr-subfacets/

Not sure this will be done in the next few months

Dominique


2015-03-13 18:01 GMT+01:00 Chris Hostetter <ho...@fucit.org>:

>
> : Is it possible to sort the facet pivot items by using a stat value like
> sum
> : or mean ?
>
> Not at the moment no.
>
> It's something i'd like to see implemented eventually, but it would
> require a *huge* amount of re-implementation of how the faceting code
> currently works.
>
>
>
> -Hoss
> http://www.lucidworks.com/
>

Re: Facet pivot sorting while combining Stats Component With Pivots in Solr 5

Posted by Chris Hostetter <ho...@fucit.org>.
: Is it possible to sort the facet pivot items by using a stat value like sum
: or mean ?

Not at the moment no.

It's something i'd like to see implemented eventually, but it would 
require a *huge* amount of re-implementation of how the faceting code 
currently works.



-Hoss
http://www.lucidworks.com/