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 Mark Mandel <ma...@gmail.com> on 2011/04/18 07:10:28 UTC

Facet sorting

Quick question -

Is it possible to sort some facets by Lex, and others by numeric value?

>From everything I've seen, it's either all or none, with no in between. Was
just curious if that was not the case.

Getting around it by doing post-sorting with comparators, but thought I may
not need that step.

Cheers,

Mark

-- 
E: mark.mandel@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) - Nov 17, 18 - Melbourne Australia
http://www.cfobjective.com.au

Hands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com

Re: Facet sorting

Posted by Mark Mandel <ma...@gmail.com>.
Aaahhh.. missed that.

So if I'm using SolrJ, do I need to set that explicitly through set(); or
can I use setFacetSort() somehow? ('cause I can't find an example anywhere,
and it's not inherently obvious).
http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/SolrQuery.html#setFacetSort(java.lang.String)

Much appreciated for pointing me in the right direction though.

Mark

On Mon, Apr 18, 2011 at 3:34 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:

> On Mon, Apr 18, 2011 at 1:10 AM, Mark Mandel <ma...@gmail.com>
> wrote:
> > Is it possible to sort some facets by Lex, and others by numeric value?'
>
> Yes, see
>
> http://wiki.apache.org/solr/SimpleFacetParameters#Parameters
>
> Example of per-field overrides:
>
> facet.field=foo
> facet.field=bar
> f.foo.facet.sort=count
> f.bar.facet.sort=index
>
> -Yonik
> http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
> 25-26, San Francisco
>



-- 
E: mark.mandel@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) - Nov 17, 18 - Melbourne Australia
http://www.cfobjective.com.au

Hands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com

Re: Facet sorting

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Apr 18, 2011 at 1:10 AM, Mark Mandel <ma...@gmail.com> wrote:
> Is it possible to sort some facets by Lex, and others by numeric value?'

Yes, see

http://wiki.apache.org/solr/SimpleFacetParameters#Parameters

Example of per-field overrides:

facet.field=foo
facet.field=bar
f.foo.facet.sort=count
f.bar.facet.sort=index

-Yonik
http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
25-26, San Francisco