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.

eZ debug

Timing: Jan 29 2025 23:47:21
Script start
Timing: Jan 29 2025 23:47:21
Module start 'layout'
Timing: Jan 29 2025 23:47:21
Module start 'content'
Timing: Jan 29 2025 23:47:21
Module end 'content'
Timing: Jan 29 2025 23:47:21
Script end

Main resources:

Total runtime0.0153 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1563151.2109
Module start 'layout' 0.00500.0034 739.367236.6563
Module start 'content' 0.00840.0053 776.023495.3125
Module end 'content' 0.01360.0016 871.335933.9766
Script end 0.0152  905.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.8857140.0002
Check MTime0.00117.4136140.0001
Mysql Total
Database connection0.00074.635910.0007
Mysqli_queries0.002717.633130.0009
Looping result0.00000.183910.0000
Template Total0.00117.410.0011
Template load0.00085.544610.0008
Template processing0.00031.836310.0003
Override
Cache load0.00053.229810.0005
General
dbfile0.00042.879180.0001
String conversion0.00000.065540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs