Using Facets

In this article

A facet is a search interface component that allows the end user to refine a query by selecting filters based on item metadata (i.e., field values). The search results that don’t match the end user’s selection disappear from the result list. Facet content is updated every time the end user interacts with other facets or the search box.

The JavaScript Search Framework also allows you to automatically reorder facets and facet values based on usage analytics data representing past end-user interactions with a search interface (see Deploy Dynamic Navigation Experience (DNE)).

Search-Facets

If your search interface window is narrow (e.g., when it’s embedded as a panel in a page or displayed on a mobile device), you must click the Sort & Filter button to view facets, which are displayed under Filters in the panel that opens.

If you’re a member of the Administrators built-in group in your Coveo organization, make sure to read the following articles:

Facet Features

Parts of a Facet

1 The Resource type facet shows a list of the type of resources that your search page contains.
2 Click the arrow to hide facet values and reduce the size of the facet.
3 Click Clear 2 filters to remove the selected values from all the facets.
4 With the Product Documentation and Glossary Entry values selected, the search results only show the types of files that match the selected values.
5 The number within parentheses shows the number of items corresponding to each Resource type.
6 Select Show more to display the full list of sources the search page uses.
  • There are several facet types, some of which look different from those visible in the figure above.

  • When selecting facet values, their order within the facet won’t change until a new query is triggered by an action on a different component (e.g. selecting a value from a different facet or interacting with a breadcrumb). The new query prompts the facet values to be reordered, pushing the selected facet to the top of the facet list.

Selecting Several Values

To refine your search, you can select more than one value in a facet and you can select values in more than one facet. Each value selected or excluded is a filter applying on top of your other selections. The search results are updated accordingly. They consist of items that contain at least one of the selected values from the facets. This is demonstrated in the context of two facets in the example below:

The following facets allow you to filter search results by year and month of publication.

Search-FacetsExample

When you select 2016, 2017, February, March, and April, the displayed search results are items published in February, March, or April 2016, or February, March, or April 2017.

Deselecting Values

Above the search results, the selected and excluded facet values are displayed. Click X next to a value to delete this filter, or click Clear to clear all filters and display the original, complete list of results matching your query.

This search interface shows all results published in any month of 2017 but May.

Search-FacetTag

Excluding Values

When you hover to the right of the result number of a facet value, an X icon appears. Click it to exclude the corresponding value. As a result, all items but those matching the excluded value appear in your search results.

Before you click X, all search results are displayed, regardless of their month of publication. When you click it, the result list updates to show all results but the 42 published in May.

Search-FacetExclude

Searching for Values

The values in a facet are typically listed by descending number of corresponding search results, but you can also use the facet search box to look for specific, less common field values. If you’re looking for a specific value, click Search and type it in the search box. You can then select or exclude this value.

Searching a Facet Value