Add Facet Value Suggestions to Query Suggestions
Add Facet Value Suggestions to Query Suggestions
Legacy feature
This article pertains to achieving relevance with the Coveo Hive framework. Coveo Hive is now in maintenance mode. See Achieve relevance for guidance on leveraging Coveo Platform relevance features with the Coveo Atomic library. |
WARNING
In the March 25, 2019 and April 18, 2019 releases of Coveo for Sitecore, there’s an issue with the Coveo Facet Value Suggestions rendering when using regular Coveo Hive search pages and Coveo for Sitecore SXA search interfaces simultaneously (see SXA Coveo Facet Value Suggestions Rendering Item Overwriting Hive Item at Installation). |
Adding facet value suggestions to Coveo Machine Learning (Coveo ML) query suggestions provides users with a simple mechanism to quickly narrow their search. As users type, query suggestions are proposed. These suggested queries also contain filtering suggestions based on a Sitecore field that you have indexed as a facet (see Make a Sitecore Field Facetable).
Enabling Facet Value Suggestions
To enable facet value suggestions
-
For a production environment, ensure that QS is enabled in your search interface (see Query Suggestions).
-
In the Sitecore Experience Editor, select the Searchbox Components placeholder. It’s located just below the searchbox.
-
Click Add here.
-
Select the Coveo Facet Value Suggestions component.
-
Create a data source for the component.
-
Select the Coveo Facet Value Suggestions.
-
In the floating toolbar, select Edit the rendering’s data source. It should be the leftmost option in the toolbar.
-
In the Basic Settings section, click Select Field.
-
Type the name of the Sitecore field whose values should be used as the facet value suggestions.
-
Set the Coveo Searchbox and Coveo Facet Value Suggestions data source options in accordance with the type of environment you’re working in (see Facet Value Suggestions and Usage in a Production Environment and Testing Facet Value Suggestions in a Development Environment).
-
In the Query Settings section, set the Expression property if needed. This property will help avoiding queries leading to no results (for example, due to filtering on a tab) on the main search interface.
-
Though not mandatory, you should add the associated facet to the search interface for a more intuitive search experience (see Add Other Components).
Facet Value Suggestions and Usage in a Production Environment
You can use the default Coveo Searchbox and Coveo Facet Value Suggestions data source field values below for your production environment. These default values ensure that your interface leverages your usage analytics and machine learning model to suggest queries along with your facet value suggestions.
Search interface component | Data source field name | Data source field value |
---|---|---|
Coveo Searchbox |
Enable Coveo Machine Learning query suggestions |
|
Coveo Facet Value Suggestions |
Use value from search box |
|
When you add facet value suggestions to QS, the suggested queries in your production environment should typically contain:
-
An autocompleted query suggestion based on the characters typed in the search box without filtering.
-
One or several query suggestions based on the characters typed in the search box with a facet value filtering applied. Each of these suggestions contain the autocompleted query suggestion, the word in, and the suggested facet value filtering.
When you click a suggested filtered query, that query is executed and, to reflect the applied filtering, the facet value is selected in your search interface.
Leading practice
Coveo Facet Value Suggestions function properly even if you don’t actually add the facet associated with your facet value suggestions to your search interface. However, inserting the related facet in the search interface makes the search experience more intuitive (see Add Other Components). |
Testing Facet Value Suggestions in a Development Environment
If you have not yet collected a sufficient amount of usage analytics and would like to preview how facet value suggestions work, you can set the Coveo Facet Value Suggestions data source Use value from search box
field value to Enabled
.
With this configuration, the searchbox component doesn’t autocomplete your query.
However, with every keystroke, the search interface performs a facet value lookup API call.
When the interface locates the searched term in the call response, the facet value suggestions for these results are displayed.
When you click a suggested filtered query, that query is executed and, to reflect the applied filtering, the facet value is selected in your search interface.
Leading practice
Coveo Facet Value Suggestions function properly even if you don’t actually add the facet associated with your facet value suggestions to your search interface. However, inserting the related facet in the search interface makes the search experience more intuitive (see Add Other Components). |