Cloud Platform

Configuring search facets

This document contains information about filtering search results with facets with the Apache Solr Search module.

Note

The Apache Solr Search module and related hooks are only available for Drupal 7.

Search facets enable users to refine or sort their search result set. Users can begin with a general search and narrow down the results as they understand better what content is available on your website. To learn more about search facets, see the following:

To enable search facets, you must install and enable the Drupal 7 Facet API module.

If you are an administrator with search settings permissions, you can go to the Apache Solr Search > Settings > Facets tab and enable the facets you want to use in your search pages. The facets displayed on the Facets tab depend on the bundles and entities that you have enabled on your website, and the other search-related modules that you have installed. For more information, read Modules for Acquia Search.

Facet configuration operations

For each enabled facet, you can select the following operations:

Configure display

You can configure how each facet displays in the search results on the Configure display page. From the Configure display page, you can configure the following:

Display widget

The Facet API includes two basic display widgets: links and links with checkboxes. Other modules (such as Facetapi Slider) can provide other display widgets.

Soft limit

The soft limit limits the number of facets displayed initially. Other facets display after clicking the Show more link.

Empty facet behavior

Empty facet behavior controls the action to take when a facet has no items. The default is not displaying the facet if the search returned no items for the facet. You can select Display text, and then enter and format the text to display for an empty facet.

Sort rules

You can configure how to sort the facets in the sort rules. Each sort rule can display in ascending or descending order, and can have a weight assigned to determine the order to apply the sort rules.

Global settings

The global settings for facet configuration apply to the facet across all realms.

Hard limit

The hard limit displays no more than the configured number of items per facet.

Minimum facet count

The minimum facet count displays facets matching in the configured number of documents. The default number is 1. You can increase the number to delete some facets, even if they contain search result items.

Configure dependencies

In order for the server to process facets, and display them to the user, dependencies must meet all conditions. Dependencies are based on either bundles or roles.

Bundle-based dependencies

Using bundle-based dependencies, you can control whether a given facet must display based on the bundle (such as content type).

Role-based dependencies

Using role-based dependencies, you can control whether a given facet must display to a user based on the user’s role.

Configure filters

The Configure filters operation enables, disables, and weights facet filters created using search-related contributed and custom modules.

Export configuration

Using the export configuration operation, you can view, copy, and paste a PHP version of the facet’s configuration. By exporting a facet’s configuration to code, you can use version control for the configuration, and export the configuration to other sites.

Block cache settings

The Apache Solr Search > Settings > Facets tab also displays your Block cache settings. For best performance, enable block caching, which you can do on the Administration > Configuration > Development > Performance page. For more information, see Page and block caching in Creating content recommendation blocks.

Acquia Help

Filter by product:

Cloud Platform common questions

If you can't find what you're looking for, try refining your search or contact our Support teamfor further assistance.