Hello, I've used apachesolr_location module and faced the problem, that country filter is not working with "country" as facet name in URLs.
When I looked into the module, I saw that there's no "name" attribute in parameters.
$facets['city'] = array(
'label' => t('City'),
'name' => 'city', //should be here
'description' => t('Filter by city.'),
'field' => 'ss_locs_city',
'field alias' => 'country' //would be useful to have it here
'field api bundles' => array('node'),
'facet mincount allowed' => TRUE,
'dependency plugins' => array('bundle', 'role'),
);
This leads to the situation, that location filters not working with country:be, but it works with ss_locs_country:be in the URLs. In fact, I had to implement hook_facetapi_facet_info_alter() to fix this and add "field alias" attribute. This worked in my case, but I'd like to suggest general solution to this -
the name attribute, actually, is the only _really_ required in facet definition, so I suggest to add it as well as "field alias" attribute, so everything will work as expected.
Please find attached patch for this purpose below.
--
Kind regards, S
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | apachesolr_location-field-name-alias-1682934-5.patch | 950 bytes | 32i |
| #4 | apachesolr_location-field-name-alias-1682934-4.patch | 1.65 KB | 32i |
| #2 | apachesolr_location-field-name-alias-1682934-2.patch | 1.65 KB | 32i |
| apachesolr_location_field_name_alias.patch | 2.05 KB | 32i |
Comments
Comment #1
nick_vhpatch is wrongly generated. Please reroll
Comment #2
32i commentedre-rolling patch.
Comment #3
nick_vhCommitted, thanks!
Comment #4
32i commentedaaand re-rolled again - I've fixed typos.
Comment #5
32i commentedcreated patch for latest build.
Comment #6
nick_vhCommitted! Thanks for following up on this issue