I'm working on a site that has a number of objects classified by year. The years range from 1600 to the current year & I have a hierarchical taxonomy: century>>decade>>year. The Apache Solr facet block allows for configuration of "Maximum filter links:" for which there is currently a limit of 100 links.
The problem is that, the 100 link limit is being applied at the year level & since the data set contains over 400 year tags, only the century with the most links are being displayed in the Apache Solr facet block. The link limit should be applied from the top down for hierarchical taxonomies. There are
5 centuries here, which have 10 decades, which have 10 years ("Great fleas have little fleas upon their backs to bite 'em, And little fleas have lesser fleas, and so ad infinitum."). My point being that the link limit should be applied at each level, not simply at the leaf.
The workaround I implemented was:
--- apachesolr.module 2011-06-13 20:48:08.000000000 +0400
+++ apachesolr.module.orig 2011-06-12 03:15:06.000000000 +0400
@@ -1159,7 +1159,7 @@
'#description' => t('The initial number of filter links to show in this block.'),
'#default_value' => isset($initial[$module][$delta]) ? $initial[$module][$delta] : variable_get('apachesolr_facet_query_initial_limit_default', 10),
);
- $limit = drupal_map_assoc(array(500, 100, 50, 40, 30, 20, 15, 10, 5, 3));
+ $limit = drupal_map_assoc(array(100, 75, 50, 40, 30, 20, 15, 10, 5, 3));
$form['apachesolr_facet_query_limit'] = array(
'#type' => 'select',
'#title' => t('Maximum filter links'),
All this does is increase the bottom level search to include the missing tags which provides the full list at the top level of the taxonomy as desired. This is inherently way less inefficient than a top down approach which ignores children for a hierarchical taxonomy
Comments
Comment #1
krlucas commentedI am also seeing this issue and can confirm that the above workaround does work (though would assume the right number depends on your data).
I wonder if the "100" upper limit was chosen for performance reasons or just because it was assumed no none would want to display more than a 100 facet links?
I would also suspect the "real" fix is non-trivial.
Comment #2
nick_vhWon't fix for 6.x-1.x. If this is still an issue, please move it to the 7.x-1.x branch