Aliasing facets in solr

Author Message

H-Works Agency

Friday 01 April 2011 4:53:54 am

Hello,

Is it possible to "alias" facet in that way :

- Say i have some results with facet "City" with result : Paris, New-York, London

- Can i "alias" the facet so London won't show anymore but London results would be aggregated in Paris facet ?

Like this :

Before :

  • Paris (1)
  • New-York (4)
  • London (6)

After :

  • Paris (7)
  • New-York (4)

And a click on Paris would show Paris & London results ?

How can this be achieved ?

Thanx in advance from any solr guru !

EZP is Great

Philippe VINCENT-ROYOL

Friday 01 April 2011 6:01:50 am

Hi,

Yes its possible to "merge" two different facet. Its not a clean method but it works.

For example if your city attr looks like in solr : attr_city_t

You ll have value like attr_city_t:paris and attr_city_t:london

When you show link, just add something like &filter[attr_city_t][]=paris&filter[attr_city_t][]=london (depends how you generate your url)

Thats all

Philippe

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

H-Works Agency

Friday 01 April 2011 7:29:49 am

Yes the prob is that results count wont be affected i think.

EZP is Great

Philippe VINCENT-ROYOL

Friday 01 April 2011 7:39:51 am

If you object have only one city, you could add count result.. else maybe try to look at advanced syntax via solr : http://wiki.apache.org/solr/SolrQuerySyntax

(im talking before filtrering)

After filtring be careful to add an "or" with your 2 attr :)

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.