Search facets

Overview

Facets are used to group search results based on predefined fields. They allow users to further narrow down search results.

PREREQUISITES: Facets are available for Elasticsearch and Azure search services.

Create facetable fields

If you want to include facets in your search results page, you must first create facetable fields. These fields can only be dynamic module items or custom fields created for any module.

The fields that are indexed by default when you create an index are not facetable. For more information, see Create search indexes.

To mark fields as facetable you need to edit or create an index.

  1. Navigate to Administration » Search indexes.
  2. Click Create a search index or open an index to edit.
  3. If you have Elasticsearch or Azure search service setup, you can see the option to specify addition fields as facetable.
  4. In the Label field you can add a name for the field visible for site visitors in the search result page.
  5. Save changes.
  6. If you edited an existing index, reindex it.

Configure Search facets widget

  1. Place the Search facets widget to the same page as the Search results widget.
  2. Select a search index. The search index must be the same one used in the Search results widget.
    You can only see indexes that have at least one field marked as facetable.
  3. Fields configured as facetable are automatically displayed.
    If you do not want to display all facetable fields in the search results page you can remove any of the by clicking the x next to the name of the field. Or you can add more from the add button.
    If you add multiple fields with the same name, only the last one added is displayed in the search results page.
  4. In the Label fields, you can change the label of the field here. For instance, you can use another language to translate the original field name. You can also leave the label field empty if you do not want to have a label name.
  5. Select how you want to sort the fields.
    • As set manually – keeps the order you have specified via dragging and dropping the fields in the field above.
    • Alphabetically – sorts the fields alphabetically according to their label name.
  6. Set whether to display item count in the facet search results.
  7. Set whether you want to collapse large facet lists. If you click Yes, only the first ten entries are displayed and a button appears to show the rest.
  8. You can save this widget template by adding a template name
  9. Click Save.

Advanced settings of the Search facets widget

In advanced settings you can configure the following options:

  • CSS class – add CSS resources.
  • Search fields - List of fields to be used in the search facets. These fields must be the same as those specified in the Search results widget.

You can also change the following labels and messages

  • Search facets header
  • Search facets label
  • Clear facets link
  • Show more link
  • Show less link

Facets and permissions

The search results from facetable fields cannot be filtered by permission, therefore the facet category includes a count of the results even if they are not accessible. Fields with sensitive information should not be made facetable.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?