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. If you switch to any of these services you also need to reindex your indexes.

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. If you want to create date and time and numerical facets, you must create fields that has a Date and time or Number field types.

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. Click the tag-manager-edit (Edit) button to configure the date and time facets.
    For the Date and time and Number facets, you can configure Step and Range grouping methods.
  6. 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.
  7. Set whether to display item count in the facet search results.
  8. 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.
  9. You can save this widget template by adding a template name
  10. 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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?