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.

The Query Suggestion (QS) feature leverages Coveo Usage Analytics (Coveo UA) to propose queries to users as they type in the search box. Clicking a suggestion completes the query and sends it to the index.

QuerySuggestions
Note

When the QS feature is enabled, Coveo for Sitecore doesn’t generate any queries against your index while the user is typing. Therefore, this feature doesn’t impact your query per month usage.

How the Suggested Queries are Determined

The relevance score of each query suggestion is determined by the following:

  • The query frequency.

  • The degree to which the query suggestion matches the typed characters.

  • The query performance.

To summarize, in order to get relevant query suggestions, you need queries and clicks on query results (see About Query Suggestions).

Important

A minimum amount of usage analytics data needs to be collected before the Coveo Searchbox component begins suggesting queries.

Note

You can use the Coveo UA bot to batch simulate visits, queries, and clicks on a site.

Enabling Query Suggestions

When you include the Coveo Searchbox rendering in a Coveo for Sitecore search interface, the Enable Coveo Machine Learning query suggestions option in the data source is set to use the default enableQuerySuggestAddon setting of the Coveo JavaScript Search Framework Omnibox component. Since that default value is true, you should have nothing to do to enable the feature from a rendering configuration standpoint.

SearchBoxQuerySuggestionsEnabled

However, a Coveo Machine Learning (Coveo ML) QS model has to be created and configured.

To enable QS in your search interface

  1. Open your search page in the Sitecore Experience Editor.

  2. Add a Coveo Searchbox component to your interface, if not already done.

  3. Add the Coveo for Sitecore Analytics component to your search interface, if not already done.

    1. Locate and select the UI Header placeholder.

      UIHeaderPlaceholder
    2. Click Add here.

    3. Select the Coveo for Sitecore Analytics component and click Select.

      CoveoForSitecoreAnalyticsSelection
    4. Create or select a data source for your Coveo for Sitecore Analytics component.

  4. Save and publish your search page.

  5. In the Coveo Administration Console, create a QS machine learning model.

  6. Collect enough usage analytics data for the search box to begin suggesting queries (see Prerequisites).