Closed (duplicate)
Project:
Facet API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 21:36 UTC
Updated:
21 Feb 2012 at 15:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
cpliakas commentedThe best way is to implement the negative facet pattern which, can be done be setting the "Minumum facet count" to "0" in the global settings. Note that the backend has to support this, and there is an issue posted against Search API that blocks this functionality. See #1306008: Negative facets not displayed when the mincount is 0 for more info. Apache Solr Search Integration supports the negative facet pattern. Faceted Navigation for Search does not.
Thanks,
Chris
Comment #2
danielnolde commentedThanks for the help, Chris.
The patch in #1306008 in comment 2 did the trick for the search_api backend.
Should we hint the setting of "minimum facet count" to 0 as a description/help text for this field (I could make a patch for this) ?
Comment #3
cpliakas commentedIf you think that would be helpful to others, then yes! I would definitely support a patch for better descriptions.
Comment #4
heacu commentedA better way is to use "filter exclusion" as documented at http://wiki.apache.org/solr/SimpleFacetParameters in the SOLR wiki ("Tagging and excluding Filters" ). This way you can get the correct counts, i.e. how many documents would there be if you deactivated the selected facet and chose the other facet instead.
I found a nifty solution for a previous project using filter exclusion: do two separate queries on the same facet field. The first facet query gives counts for the documents with a filter applied. The second query gives counts for the same facet field, but with the filter excluded. You then merge the sets, prioritizing counts from the first set. Clicking on one of the facets from the first set will further narrow the query. Clicking on a facet from the second set will unset the initial filter, and then apply the new one. I distinguished the two sets by shading, as evident from the attached snapshot. The darker facets will be added to the query, thus narrowing search. The orangeish facets replace the existing filter.
This system works great because it saves users the annoying step of deselecting a facet.
Comment #5
cpliakas commentedThis is really cool! Have you run this by the Apache Solr Search Integration guys? If that module would support this option, Facet API coud very easily integrate with it.
Thanks for posting,
Chris
Comment #6
cpliakas commentedMarking as fixed since multiple solutions have been provided and the feature suggested in #4 should be posted against Apache Solr Search Integration.
Comment #7
danielnolde commentedLet's continue the discussion about keeping full (unfiltered) facet item counts for facets with only one item active at http://drupal.org/node/1446824
Comment #8
cpliakas commentedYes, moving to #1446824: Support the multi-select facet feature of Solr where the associated counts are maintained as if no contraints have been applied is a good idea.
Thanks,
Chris