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 Zheng Lin Edwin Yeo <ed...@gmail.com> on 2016/10/26 07:16:14 UTC

JSON Facet Syntax Sorting

Hi,

I'm using Solr 6.2.1.

For the JSON Facet Syntax, are we able to sort on multiple values at one go?

Like for example, if I want to sort by count, follow by the average price.
is this the correct way tot do?

 json.facet={
   categories:{
     type : terms,
     field : cat,
     sort : { count : desc},
     sort : { x : desc},
     facet:{
       x : "avg(price)",
       y : "sum(price)"
     }
   }
 }


Regards,
Edwin

Re: JSON Facet Syntax Sorting

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
Thanks for the update Yonik.

Regards,
Edwin

On 26 October 2016 at 20:07, Yonik Seeley <ys...@gmail.com> wrote:

> On Wed, Oct 26, 2016 at 3:16 AM, Zheng Lin Edwin Yeo
> <ed...@gmail.com> wrote:
> > Hi,
> >
> > I'm using Solr 6.2.1.
> >
> > For the JSON Facet Syntax, are we able to sort on multiple values at one
> go?
> >
> > Like for example, if I want to sort by count, follow by the average
> price.
> > is this the correct way tot do?
>
> Sorting by multiple metrics isn't yet supported.
>
> -Yonik
>
> >  json.facet={
> >    categories:{
> >      type : terms,
> >      field : cat,
> >      sort : { count : desc},
> >      sort : { x : desc},
> >      facet:{
> >        x : "avg(price)",
> >        y : "sum(price)"
> >      }
> >    }
> >  }
> >
> >
> > Regards,
> > Edwin
>

Re: JSON Facet Syntax Sorting

Posted by Yonik Seeley <ys...@gmail.com>.
On Wed, Oct 26, 2016 at 3:16 AM, Zheng Lin Edwin Yeo
<ed...@gmail.com> wrote:
> Hi,
>
> I'm using Solr 6.2.1.
>
> For the JSON Facet Syntax, are we able to sort on multiple values at one go?
>
> Like for example, if I want to sort by count, follow by the average price.
> is this the correct way tot do?

Sorting by multiple metrics isn't yet supported.

-Yonik

>  json.facet={
>    categories:{
>      type : terms,
>      field : cat,
>      sort : { count : desc},
>      sort : { x : desc},
>      facet:{
>        x : "avg(price)",
>        y : "sum(price)"
>      }
>    }
>  }
>
>
> Regards,
> Edwin