Add Facet Value Suggestions to Query Suggestions

Warning
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
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).

Facet value suggestions | Coveo for Sitecore 5

Enabling Facet Value Suggestions

To enable facet value suggestions

  1. For a production environment, ensure that QS is enabled in your search interface (see Query Suggestions).

  2. In the Sitecore Experience Editor, select the Searchbox Components placeholder. It’s located just below the searchbox.

    Search box components placeholder | Coveo for Sitecore 5
  3. Click Add here.

  4. Select the Coveo Facet Value Suggestions component.

    Facet value suggestions | Coveo for Sitecore 5
  5. Create a data source for the component.

  6. Select the Coveo Facet Value Suggestions.

  7. In the floating toolbar, select Edit the rendering’s data source. It should be the leftmost option in the toolbar.

  8. In the Basic Settings section, click Select Field.

  9. Type the name of the Sitecore field whose values should be used as the facet value suggestions.

  10. 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).

  11. 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.

  12. 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

Use Default (true)

Coveo Facet Value Suggestions

Use value from search box

Use Default (false)

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.

    Facet value suggestions without filtering | Coveo for Sitecore 5
  • 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.

    Facet value suggestions with filtering | Coveo for Sitecore 5

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.

Tip
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.

Facet value suggestions without ML | Coveo for Sitecore 5

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.

Tip
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).