Searching with Coveo Cloud
- Getting Started With Coveo Search Pages
- Understanding the Query Expression
- Query Syntax Reference
- Search Prefixes and Operators
- Advanced Field Queries
- Query Correction Feature
- Nested Queries
- Geolocalized Results
- Misspelled Words
- Understanding Facets
- Understanding Result Folding
- Understanding Persistent Queries
- Understanding Stemming
A facet is a search page control consisting in a list of values for a given field (see Understanding Fields). It allows you to refine search results by filtering out those that do not have the selected value for the facet field. The facet content is updated each time you perform a new query.
Beside each facet option, the number of occurrences of the facet field value across the search results is displayed, helping you to quickly grasp and refine the search results.
In the following figure, the Year facet lists the publication year values found in the
@year field of the search results. Year 2015 is the most common value, but because 2017 is selected, search results are refined to only show items published in 2017.
|2||Facet options – Click an option or its check box to narrow search results to this option. Selected values are highlighted, and a plus sign appears in front of the number of occurrences for other values to indicate that selecting them would add the corresponding number of results to the page.|
|3||Search appears when there are more available options than displayed. Click and type a few characters to easily find and select additional options.|
|4||X – Click to clear all selected options.|
|5||Facet settings – Click to show option sorting alternatives, to save the options you selected or to collapse the facet.|
|6||Extend/Reduce control – Click to extend or to reduce the list of visible items.|
If your search page window is very narrow, e.g., when embedded as a panel in a page or when displayed on a mobile device, facets are available in the Filter drop-down menu.
Above the search results, the selected and excluded facet values are displayed. Click the X next to a result to delete this filter, or click Clear to clear all filters and display the original, complete list of results matching your query.
Moreover, when hovering right from the result number of a facet option, an X button appears. Click this button to exclude the corresponding option, i.e., to display all items in the search results, except for those that have the selected value for this facet field.
With the facet below, all items but the 42 published in May are displayed in the search results.
Searching for Options
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 are looking for a specific value, click Search and type it in the search box. You can then select or exclude this value.
Selecting Several Options
You can select more than one option within a facet. The search results are updated accordingly.
Typically, when you select more than one option in a facet, these options alternatives one to another. An
OR operator therefore applies to your options: the items displayed in the search result page are those that have at least one of the selected values in the facet field.
The following facet allows you to select item publication months. You select September, October, and November, so that your search result page only displays the 1,376 items published during one of those months. Search results are published either in September or in October or in November.
You can also choose to let the search page user choose which operator to apply to the facet options, especially in multi-value facets (see Multi-Value Fields In Facets). This option, Enable toggling operator, displays an additional button next to the facet name to allow the user to switch between operators. The button indicates that the
OR operator applies and allows switching to the
With the following facets, items authored by John Smith, Barbara Allen, or both are displayed as search results. A user can click the button to display results authored by both John Smith and Barbara Allen.
Similarly, the button shows that the
AND operator is active and allows users to switch to the
Multi-Value Fields In Facets
Facets also support multi-value fields (see Multi-Value Fields). Each of the field values is displayed in the facet as a separate option. Search results with more than one value for a facet field are displayed in the search result page from the moment you select one of these values in the facet.
Email messages can have multiple recipients. In the To facet, the
OR operator applies by default. In this case, when you select two or more names, the search results consist in emails sent to either recipients, or to both.
However, if you are looking for a specific email with several recipients, you can use the
AND operator in the To facet to filter your search results. So, when you select two or more names, only emails with a recipient list including all the selected names are displayed as search results.
You can select options in more than one facet to refine your search. Each facet is a filter applied on top of the other facets.
The following facets allow you to filter search results by year and month of publication.
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.
A range facet is a type of facet that displays options consisting in ranges of numerical values. These ranges are computed from the facet field values of the query results.
Like for computed facet, a calculation (sum, average, minimum, or maximum) can also be made on the values found for the numerical field associated with the facet.
Any option available for a regular facet is also available for a range facet. This also implies that you must specify a field value for this component to work.
When you index data from a customer relationship management (CRM) system, a numerical range facet can display ranges of Opportunity Amounts together with the number of opportunities and the total amount for each opportunity amount range.
A slider facet contains a slider widget that allows the end user to filter search results based on a range of numerical values (see Understanding Fields).
You can use the facet slider to select a range of publication dates. Only items published within this range appear in your search results.