See here #1415360: Display inactive facets:
Currently there is a way to hide the facets block when an item is selected by using the "Do not display active items" filter in the facet configuration.
What I'm hoping to do is the opposite - display the full facet block even if an item is active, e.g.
Stage 1:
Stage 2:
It seems relatively straight-forward but I'm sure it isn't. I'm happy to work on a patch if you also think it's a useful feature but would appreciate a pointer to where to start - whether this should be done as a filter, a setting in the facet, or the block configuration, etc
Comments
Comment #1
cpliakas commentedHi miiimooo,
The solution here is to set the "Minimum facet count" to 0 since we have to tell the server to return facets even if they don't have matches in the result set. It is important to note that the backend has to support this, and the last time I checked Apache Solr Search Integration does Search API does not. See the issue posted at #1306008: Negative facets not displayed when the mincount is 0 for more details.
Thanks,
Chris
Comment #2
miiimoooHi thanks. I realise my problem or request is more complicated than what I originally described. What I am trying to do is keep the facet "on the first level" meaning something like:
Stage 1
Stage 2
Maybe it's a "won't fix" but somehow it could be useful for constructing navigations based on facets.
Comment #3
cpliakas commentedI am trying to wrap my brain around this. In my mind I keep on coming back to the negative facet solution coupled with the work being done at #1393928: Add a per-facet setting that allows only one item to be active at a time. I think it might be helpful for you to tell me why the functionality illustrated in the screenshot below doesn't meet your needs.
Original state
Selected state
Thanks for bearing with me on this one,
Chris
Comment #4
miiimoooGood question. It is sort of handy but can actually be done using views aggregation (see here http://d7.fern.org/campaign/carbon-trading). Maybe it's not something facetapi should be able to do. Feel free to postpone.
Comment #5
cpliakas commentedI get it now! Thanks for the example. So the difference between my example and the use case you are looking to achieve is that my example displays the counts reflecting the filtered results whereas yours always displays the counts as if no filters were selected.
I would say this definitely depends on the backend, and I am unclear whether Solr would support something like this. Based on my knowledge of Solr, this would require a separate empty query to display the aggregate counts since faceted navigation is really geared towards narrowing down result sets and displaying counts that relate directly to the result set being displayed.
My first thought is that View aggregation (as you mentioned) is probably the most natural solution in Drupal right now. My second thought is that this would either be a cool add-on to Apache Solr Search Integration or a separate contrib that leverages both Apache Solr Search Integration and Fact API to provide this block. It might be a little tricky to implement, though, because Facet API does work on the premise that results will be filtered down and the aggregate counts eill change as a result.
Thanks for the use case,
Chris
EDIT: My assessment above is wrong. This is something Solr can do for us. See http://drupal.org/node/1431926#comment-5582734. Discussion continued at #1446824: Support the multi-select facet feature of Solr where the associated counts are maintained as if no contraints have been applied.
Comment #6
cpliakas commentedHm. This might be what you are looking to do:
http://drupal.org/node/1431926#comment-5582734
If this is the case, we should move discussions to #1446824: Support the multi-select facet feature of Solr where the associated counts are maintained as if no contraints have been applied and loop in the Apache Solr Search Integration maintainers.
Comment #7
danielnolde commentedAnd let's draw in Thomas Seidl, the maintainer of search_api and search_api_solr, since i'm using the Search API module with Apache Solr as backend.
Comment #8
danielnolde commentedSo, are we moving discussion to #1446824?
Comment #9
cpliakas commentedYes, let's move the discussion to #1446824: Support the multi-select facet feature of Solr where the associated counts are maintained as if no contraints have been applied. We should also loop in Nick Veenhof who has a lot of Solr specific expertise.