Closed (fixed)
Project:
Solr
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2007 at 23:40 UTC
Updated:
23 Oct 2007 at 20:31 UTC
Jump to comment: Most recent file
To eliminate the redundant display of facets on search result pages, simply call array_unique on the facet items array.
So, this:
function theme_solr_facet_filters($type, $fq){
...
return theme('item_list', $items);
}
becomes this:
function theme_solr_facet_filters($type, $fq){
...
return theme('item_list', array_unique($items));
}
I will likely remove the links and add styling to selected facets within the facet display area to reinforce the search context as well. This is what I have done in the past. But array_unique will prevent redundant facets from being displayed either way.
Attaching a simple patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | solr.theme_facet_limit_0.patch | 297 bytes | cfennell |
| solr.theme_facet_limit.patch | 0 bytes | cfennell |
Comments
Comment #1
cfennell commentedsee attached.
Comment #2
hickory commentedFixed, thanks for the patch. If you manage to add some decent styling for the chosen filters, that would be much appreciated.
Comment #3
cfennell commentedOne thing I'd like to do w/facet output is to alter the text to my liking. What do you think about the idea of building a theme function to handle just this task? So, before displaying the facet link, for example, you call a text-altering theme:
facet_filter_text calls something like:
I think I'll be able to style the entire facet links via attributes in the item_list, but I need to actually change the text on display, hence this function. You can also call this in theme_solr_facet It did, however, occur to me that this theme function might be better suited as a node_hook though.
I guess it's food for thought anyway....
Comment #4
(not verified) commented