A common requirement for search integration and facets might be to display a facet block independent of the search. E.g., display a list of popular taxonomy terms on the front page, linked to the appropriately filtered search page.
The attached patch would make this possible by adding a Views display plugin that allows to create such blocks.
Downsides are that you have to manually configure your other facet blocks to ignore the search started by that block, and that the new "Search API facets block" display will be available for all base tables (since Views seemingly doesn't allow you to specify something else).
The display will only be available if both the Views and the Facets extension modules are enabled.

Comments would be very much appreciated!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Looks like code for adding db-facets?

drunken monkey’s picture

AND for adding a view mode to search pages! Yes …
Hm, I think I'm maybe not that good at making patches with git yet. ^^" (Ah, OK, I forgot "--cached" …) Attached should be the correct patch.

drunken monkey’s picture

Status: Active » Needs review
drunken monkey’s picture

Updated patch, to fit current repo code, and with a short README (to be a bit expanded, but I'm in a bit of a hurry).

drunken monkey’s picture

And this includes really all changes …

drunken monkey’s picture

Updated patch.
+ Complete README.txt, mentioning a short "How to" and a few possible caveats.
+ "More link" now works.
+ Minor other tweaks.

drunken monkey’s picture

Previous patch removes paging.

fago’s picture

Looks good to me, however I found one very critical issue:

+      // Add range and search ID (if it wasn't already set)

Missing trailing point!

Feature request: Add a views option to hide facet counts.

drunken monkey’s picture

Status: Needs review » Fixed

Missing trailing point!

Oh, thanks for spotting this! Unimaginable what havoc this might have caused if going unnoticed!

Although I have to admit my comments aren't really up-to-date with the Drupal coding standards, as they seem to be updated every five minutes …

Feature request: Add a views option to hide facet counts.

Override the theme function.

Anyways, since this seems to work (and I corrected the critical bug above), I finally committed the patch. (And finally have no more patches lying around in the module, yay!)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.