Using Facets

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.

You can use the Interface Editor to manage your facets (i.e., to add, edit, or remove them).

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 Deploying Dynamic Navigation Experience).

Search-Facets

If your search interface window is narrow, such as when it’s embedded as a panel in a page or displayed on a mobile device, facets are available in the Filters drop-down menu.

For example:

Search-FacetFilterButton

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

Facet Features

Parts of a Facet

1 The Type facet shows a list of item (i.e., search result) types.
2 With the Account and Opportunity values selected, the search results only show items of these types.
3 The number of matching search results for each selected facet value.
4 Search appears when there are additional values available. Click and type a few characters to search these values.
5 Click **X** to clear all selected values in a facet.
6 In the More menu (More icon), you can reorder facet values by number of Occurrences, Score, or Label, in either Ascending or Descending order.
7 In the More menu, select Collapse to hide facet values and reduce the size of the facet.
8 Hover over a facet value and click **X** on the right to exclude the corresponding items from the search results.
9 Click Expand icon to extend or Reduce icon to reduce the list of values.

There are several facet types, some of which look different from those visible in the figure above.

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 and show the search results matching all your selections only.

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

Recommended Articles