Closed (fixed)
Project:
Search API
Version:
7.x-1.0-beta10
Component:
Facets
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2011 at 16:12 UTC
Updated:
13 Jul 2015 at 09:14 UTC
Jump to comment: Most recent
Comments
Comment #1
drunken monkeyWith the move to Facet API (#1182614: Integrate with Facet API) the display part will become much easier for you to do.
However, this isn't really planned for the Search API directly, as this would require a significant API change (or addition), which I think would benefit only few users.
Also, and probably more importantly, I don't think such facets are even supported by Solr.
Anyways, since you would want all facets to be displayed, you can simply code this for yourselves. Just save the facets for a blank search somewhere and always complete the displayed facets with the missing ones.
Comment #2
-otto- commentedThanks for your fast reply.
The blank search is a good idea. I'll give that a go.
I think I could also use this to show the facets on a non-search page, clicking a facet would then redirect to the search (why? well, some clients want strange things, like showing the facets on a totally unrelated page).
I'll take a look at it this weekend when I have some time to dig into the API.
and btw, great module. thx for that :)
Comment #3
drunken monkeyI don't think that's strange at all, this could be very useful for landing pages and the like – in fact, there is already a Views display plugin ("Facet block") that you can use to do exactly that. However, as you need the other functionality, too, anyways, you are probably better off with a custom solution.
Comment #4
derekwebb1 commentedI am researching this same need for a client project. subscribing
Comment #5
henrijs.seso commentedI don't get this.
Removal of facets with results happens in Search APIprotected function addFacetFilter. Just commenting out line$query_filter->condition($field, $filter);from filequery_type_term.incdoes the trick.Is there a way to tell Search API not to filter facets from code in other module? I am developing one for clients - it places all facets in single form with one submit button and client wants to see more "no results" pages ;)
Comment #6
msizec commentedI would like to do the same here : display all facets, even if there is no results in the view.
Is there a way now, 4 yours later, to do this easily ?
If not, could you give me more clues ?
Would really appreciate ... thx !
Comment #7
drunken monkeyYou can set the minimum count to 0 for the facet, that should work.
Comment #8
msizec commenteddrunken monkey, it works as intended : showing facets when there are results. But the issue/question here is to show them when there are no results ...
https://www.drupal.org/node/2512864
Comment #9
drunken monkeyAh, then you are probably using the "Database" backend for your server and would need #2219897: Show facets on "no results found" search.