We currently have a performance issue since all possible facets are being requested, not just those needed for the enabled blocks.
In addition, many of the hook_block implementations have a fair amount of duplicate code.
The proposed feature: apachesolr.module will do a hook invocation to find all fields where there is a module that wants to implement a facet block. All blocks would be manged also via apachesolr.module, so individual modules would not have to implement as much code.
Obviously, the individual modules would have to provide callbacks for some of the logic.
Comments
Comment #1
aufumy commentedSounds good. I do also like the idea of checkboxes on admin page to check which fields to facet;
http://drupal.org/node/281810
Comment #2
paul.lovvik commentedThis patch creates a new settings panel that can be used to configure which facets are active. Only the active facets appear on the block configuration page. Also the search url contains only the active facets.
Comment #3
pwolanin commentedLooks like a good start, but we need to think about whether we want to call the hook fmor apachesolr.module or apachesolr_search.module
Comment #4
JacobSingh commentedThis patch address a bug wherein a null is treated as an array in the $form and throws a warning.
It also changes "Facet" to "filter" where exposed to the user and adds some help text.
Comment #5
JacobSingh commentedHere is another patch (containing #4 as well) which adds a link for admins to the filter configuration screen below each facet block.
Comment #6
JacobSingh commentedWhoops, sorry that patch had some debugging stuff in it.
Re-rolled:
Comment #7
pwolanin commentedI see a significant bug here:
That assumes that the delta is the same as the facet field, which we know is not true. With this code, I thin kwe need:
$params['facet.field'][] = $facet_value;but we shoudl rename these vars for clarity.
Comment #8
pwolanin commentedAlso, t() strings should not have extra white space in them.
Comment #9
pwolanin commentedAlso, the node type facet code should be moved out of the framework module.
Comment #10
pwolanin commentedI'm re-working this patch now.
Comment #11
pwolanin commentednot working yet, but getting there.
Comment #12
pwolanin commentedstarting to work - needed uasort to preserve array keys, etc
Comment #13
pwolanin commentedmore rewriting - removes block code duplication.
Also, we had some really odd/bad code:
Which meant we were requesting exgtra facets and then throwing them away. I modified the query so that we alsys add a default limit for the # of facets returned.
Comment #14
pwolanin commentednote lots of moving around here - net is only +39 lines thanks to reduced code duplication
Comment #15
pwolanin commentedComment #16
pwolanin commentedcommitted to 6.x - hopefully I didn't miss anything
Comment #17
pwolanin commented