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 Aleksander Akerø <al...@gurusoft.no> on 2013/08/12 10:02:55 UTC

Facet field display name

Hi

I wondered if there was some way to configure a display name for facet
fields. Either that or some way to display nordic letters without it
messing up the faceting.

Say I wanted a facet field called "område" (norwegian, "area" in english).
Then I would have to create the field something like this in schema.xml:

<field name="omrade" type="string" indexed="true" stored="true"
required="false" />

But then I would have to do a replace to show a "prettier" name in
frontend. It would be preferred not to do this sort of hardcoding, as I
would have to do this for all the facet fields.


Either that or I could try encoding the 'å' like this:

<field name="omr&#229;de" type="string" indexed="true" stored="true"
required="false" />

Then it will show up with a pretty name, but the faceting will fail. Maybe
this is due to encoding issues, seen as the frontend is encoded with
ISO-8859-1?


So does anyone have a good practice for either getting this sort of problem
working properly. Or a way to define an alternative "display name" for a
facet field, that I could display instead of the field.name?


*Aleksander Akerø*
Systemkonsulent
Mobil: 944 89 054
E-post: aleksander@gurusoft.no

*Gurusoft AS*
Telefon: 92 44 09 99
Østre Kullerød
www.gurusoft.no

Re: Facet field display name

Posted by Jason Hellman <jh...@innoventsolutions.com>.
It's been my experience that using they convenient feature to change the output key still doesn't save you from having to map it back to the field name underlying it in order to trigger the filter query.  With that in mind it just makes more sense to me to leave the effort in the View portion of the design.  

On Aug 12, 2013, at 6:34 AM, Peter Sturge <pe...@gmail.com> wrote:

> 2c worth,
> We do lots of facet lookups to allow 'prettyprint' versions of facet names.
> We do this on the client-side, though. The reason is then the lookups can
> be different for different locations/users etc. - makes it easy for
> localization.
> It's also very easy to implement such a lookup, without having to disturb
> the innards of Solr...
> 
> 
> 
> On Mon, Aug 12, 2013 at 2:25 PM, Erick Erickson <er...@gmail.com>wrote:
> 
>> Have you seen the "key" parameter here:
>> 
>> http://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key
>> 
>> it allows you to label the output key anything you want, and since these
>> are
>> field names, this seems to-able.
>> 
>> Best,
>> Erick
>> 
>> 
>> On Mon, Aug 12, 2013 at 4:02 AM, Aleksander Akerø <aleksander@gurusoft.no
>>> wrote:
>> 
>>> Hi
>>> 
>>> I wondered if there was some way to configure a display name for facet
>>> fields. Either that or some way to display nordic letters without it
>>> messing up the faceting.
>>> 
>>> Say I wanted a facet field called "område" (norwegian, "area" in
>> english).
>>> Then I would have to create the field something like this in schema.xml:
>>> 
>>> <field name="omrade" type="string" indexed="true" stored="true"
>>> required="false" />
>>> 
>>> But then I would have to do a replace to show a "prettier" name in
>>> frontend. It would be preferred not to do this sort of hardcoding, as I
>>> would have to do this for all the facet fields.
>>> 
>>> 
>>> Either that or I could try encoding the 'å' like this:
>>> 
>>> <field name="omr&#229;de" type="string" indexed="true" stored="true"
>>> required="false" />
>>> 
>>> Then it will show up with a pretty name, but the faceting will fail.
>> Maybe
>>> this is due to encoding issues, seen as the frontend is encoded with
>>> ISO-8859-1?
>>> 
>>> 
>>> So does anyone have a good practice for either getting this sort of
>> problem
>>> working properly. Or a way to define an alternative "display name" for a
>>> facet field, that I could display instead of the field.name?
>>> 
>>> 
>>> *Aleksander Akerø*
>>> Systemkonsulent
>>> Mobil: 944 89 054
>>> E-post: aleksander@gurusoft.no
>>> 
>>> *Gurusoft AS*
>>> Telefon: 92 44 09 99
>>> Østre Kullerød
>>> www.gurusoft.no
>>> 
>> 


Re: Facet field display name

Posted by Peter Sturge <pe...@gmail.com>.
2c worth,
We do lots of facet lookups to allow 'prettyprint' versions of facet names.
We do this on the client-side, though. The reason is then the lookups can
be different for different locations/users etc. - makes it easy for
localization.
It's also very easy to implement such a lookup, without having to disturb
the innards of Solr...



On Mon, Aug 12, 2013 at 2:25 PM, Erick Erickson <er...@gmail.com>wrote:

> Have you seen the "key" parameter here:
>
> http://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key
>
> it allows you to label the output key anything you want, and since these
> are
> field names, this seems to-able.
>
> Best,
> Erick
>
>
> On Mon, Aug 12, 2013 at 4:02 AM, Aleksander Akerø <aleksander@gurusoft.no
> >wrote:
>
> > Hi
> >
> > I wondered if there was some way to configure a display name for facet
> > fields. Either that or some way to display nordic letters without it
> > messing up the faceting.
> >
> > Say I wanted a facet field called "område" (norwegian, "area" in
> english).
> > Then I would have to create the field something like this in schema.xml:
> >
> > <field name="omrade" type="string" indexed="true" stored="true"
> > required="false" />
> >
> > But then I would have to do a replace to show a "prettier" name in
> > frontend. It would be preferred not to do this sort of hardcoding, as I
> > would have to do this for all the facet fields.
> >
> >
> > Either that or I could try encoding the 'å' like this:
> >
> > <field name="omr&#229;de" type="string" indexed="true" stored="true"
> > required="false" />
> >
> > Then it will show up with a pretty name, but the faceting will fail.
> Maybe
> > this is due to encoding issues, seen as the frontend is encoded with
> > ISO-8859-1?
> >
> >
> > So does anyone have a good practice for either getting this sort of
> problem
> > working properly. Or a way to define an alternative "display name" for a
> > facet field, that I could display instead of the field.name?
> >
> >
> > *Aleksander Akerø*
> > Systemkonsulent
> > Mobil: 944 89 054
> > E-post: aleksander@gurusoft.no
> >
> > *Gurusoft AS*
> > Telefon: 92 44 09 99
> > Østre Kullerød
> > www.gurusoft.no
> >
>

Re: Facet field display name

Posted by Raymond Wiker <rw...@gmail.com>.
I'm guessing that this will only be a partial solution, as you'll want to
use the "real" field name for filtering, and the encoding problems will
still have to be solved (since there will be a need to support the national
characters in the field values as well as the field names...)

Personally, I would handle the "display names" on the front-end side... I
would also make sure that the front-end uses UTF-8 - there is simply no
excuse to use iso-8859-1 (or other restricted 8-bit encodings) anymore.


On Mon, Aug 12, 2013 at 3:25 PM, Erick Erickson <er...@gmail.com>wrote:

> Have you seen the "key" parameter here:
>
> http://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key
>
> it allows you to label the output key anything you want, and since these
> are
> field names, this seems to-able.
>
> Best,
> Erick
>
>
> On Mon, Aug 12, 2013 at 4:02 AM, Aleksander Akerø <aleksander@gurusoft.no
> >wrote:
>
> > Hi
> >
> > I wondered if there was some way to configure a display name for facet
> > fields. Either that or some way to display nordic letters without it
> > messing up the faceting.
> >
> > Say I wanted a facet field called "område" (norwegian, "area" in
> english).
> > Then I would have to create the field something like this in schema.xml:
> >
> > <field name="omrade" type="string" indexed="true" stored="true"
> > required="false" />
> >
> > But then I would have to do a replace to show a "prettier" name in
> > frontend. It would be preferred not to do this sort of hardcoding, as I
> > would have to do this for all the facet fields.
> >
> >
> > Either that or I could try encoding the 'å' like this:
> >
> > <field name="omr&#229;de" type="string" indexed="true" stored="true"
> > required="false" />
> >
> > Then it will show up with a pretty name, but the faceting will fail.
> Maybe
> > this is due to encoding issues, seen as the frontend is encoded with
> > ISO-8859-1?
> >
> >
> > So does anyone have a good practice for either getting this sort of
> problem
> > working properly. Or a way to define an alternative "display name" for a
> > facet field, that I could display instead of the field.name?
> >
> >
> > *Aleksander Akerø*
> > Systemkonsulent
> > Mobil: 944 89 054
> > E-post: aleksander@gurusoft.no
> >
> > *Gurusoft AS*
> > Telefon: 92 44 09 99
> > Østre Kullerød
> > www.gurusoft.no
> >
>

Re: Facet field display name

Posted by Erick Erickson <er...@gmail.com>.
Have you seen the "key" parameter here:
http://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key

it allows you to label the output key anything you want, and since these are
field names, this seems to-able.

Best,
Erick


On Mon, Aug 12, 2013 at 4:02 AM, Aleksander Akerø <al...@gurusoft.no>wrote:

> Hi
>
> I wondered if there was some way to configure a display name for facet
> fields. Either that or some way to display nordic letters without it
> messing up the faceting.
>
> Say I wanted a facet field called "område" (norwegian, "area" in english).
> Then I would have to create the field something like this in schema.xml:
>
> <field name="omrade" type="string" indexed="true" stored="true"
> required="false" />
>
> But then I would have to do a replace to show a "prettier" name in
> frontend. It would be preferred not to do this sort of hardcoding, as I
> would have to do this for all the facet fields.
>
>
> Either that or I could try encoding the 'å' like this:
>
> <field name="omr&#229;de" type="string" indexed="true" stored="true"
> required="false" />
>
> Then it will show up with a pretty name, but the faceting will fail. Maybe
> this is due to encoding issues, seen as the frontend is encoded with
> ISO-8859-1?
>
>
> So does anyone have a good practice for either getting this sort of problem
> working properly. Or a way to define an alternative "display name" for a
> facet field, that I could display instead of the field.name?
>
>
> *Aleksander Akerø*
> Systemkonsulent
> Mobil: 944 89 054
> E-post: aleksander@gurusoft.no
>
> *Gurusoft AS*
> Telefon: 92 44 09 99
> Østre Kullerød
> www.gurusoft.no
>

Re: Facet field display name

Posted by "tamanjit.bindra@yahoo.co.in" <ta...@yahoo.co.in>.
Would it not be convenient to replace these alphabets with "pretty" alphabets
in the application?



--
View this message in context: http://lucene.472066.n3.nabble.com/Facet-field-display-name-tp4083915p4083928.html
Sent from the Solr - User mailing list archive at Nabble.com.