solr: how to change display name of a facet?

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

solr: how to change display name of a facet?

okayndc
Hello,

Is there a way to change the display name (that contains spaces or special
characters) for a facet without changing the value of the facet field? For
example if my facet field name is 'category', I want to change the display
name of the facet to 'Categories and Stuff'

I've experimented with this:
<str name="facet.field">{!ex=dt key=Categories and Stuff}category</str>

I'm not really sure what 'ex=dt' does but it's obvious that 'key' is the
desired display name? If there are spaces in the 'key' value, the display
name gets cut off.  What am I doing wrong?

Any help is greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: solr: how to change display name of a facet?

Yonik Seeley-2-2
On Thu, May 3, 2012 at 2:26 PM, okayndc <[hidden email]> wrote:
[...]
> I've experimented with this:
> <str name="facet.field">{!ex=dt key=Categories and Stuff}category</str>
>
> I'm not really sure what 'ex=dt' does but it's obvious that 'key' is the
> desired display name? If there are spaces in the 'key' value, the display
> name gets cut off.  What am I doing wrong?

http://wiki.apache.org/solr/LocalParams
For a non-simple parameter value, enclose it in single quotes

"ex" excludes filters tagged with a value.
See
http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams

-Yonik
lucenerevolution.com - Lucene/Solr Open Source Search Conference.
Boston May 7-10
Reply | Threaded
Open this post in threaded view
|

Re: solr: how to change display name of a facet?

okayndc
Awesome, thanks!

On Thu, May 3, 2012 at 2:32 PM, Yonik Seeley <[hidden email]>wrote:

> On Thu, May 3, 2012 at 2:26 PM, okayndc <[hidden email]> wrote:
> [...]
> > I've experimented with this:
> > <str name="facet.field">{!ex=dt key=Categories and Stuff}category</str>
> >
> > I'm not really sure what 'ex=dt' does but it's obvious that 'key' is the
> > desired display name? If there are spaces in the 'key' value, the display
> > name gets cut off.  What am I doing wrong?
>
> http://wiki.apache.org/solr/LocalParams
> For a non-simple parameter value, enclose it in single quotes
>
> "ex" excludes filters tagged with a value.
> See
>
> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams
>
> -Yonik
> lucenerevolution.com - Lucene/Solr Open Source Search Conference.
> Boston May 7-10
>