This module adds an option to list active facets above search results. A hyperlink "remove filter" also shows up next to each active facet so the user can quickly clear those.

Facet combinations as well as facets on hierarchical fields (e.g. taxonomies) are supported.

Requirements

Installation

Search API Page

  • Edit the page at admin/config/search/search_api/page
  • Check Show list of active facets above search results
  • Save

Search API View

  • Edit the view at admin/structure/views
  • Under Header, add Global: Result summary
  • Save
  • Append the list of active facets via a custom module:
    /**
     * Implements hook_views_pre_render().
     */
    function mymodule_views_pre_render(&$view) {
      if ($view->name == 'mymodule_myview') {
        $active_facets = facetapi_active_facets_build_text();
        if ($active_facets) {
          $view->header['result']->options['content'] .= ' ' . t('in') . ' ' . $active_facets;
        }
      }
    }
    

Drupal 8+

The module facets_summary (part of facets) provides an equivalent functionality in Drupal 8+.

Supporting organizations: 

Project information

Releases