Query correction feature

Coveo supports a query correction feature (also known as Did You Mean). This feature can suggest substitutes for, or even automatically correct, misspelled keywords. It also provides suggestions for properly spelled keywords.

The query correction feature will first try to use an index-based system to provide potential corrections.

If the index-based system can’t provide any corrections, a second fallback system based on a Coveo Machine Learning (Coveo ML) Query Suggestion (QS) model will be used. As such, you should make sure that your QS model is correctly configured.

Example

A user is trying to find a specific movie (Ex Machina) on your theater’s search page. They send a query with the misspelled keywords Ex Manchia.

  • If the query doesn’t return any results: The query correction feature automatically corrects the keywords to Ex Machina, because Ex Machina is similar, and triggers a new query using the new keywords.

    Query correction replaces the misspelled keywords
  • If the query only returns a few results: The query correction feature displays the results but suggests the keywords Ex Machina to the user.

    Query correction suggests keywords with more results

About the query correction systems

You won’t have to choose between the index-based and QS-based query correction systems. Both have specific features and limitations, and they work together to provide the best possible corrections in most situations.

Note

Generally, the query correction feature doesn’t correct queries that were processed by a Coveo ML Automatic Relevance Tuning (ART) model for which the Intelligent Term Detection (ITD) feature is enabled. In rare cases, however, the query correction feature may process these queries.

Features of the index-based system

  • Corrections are based explicitly on the index corpus, as opposed to user signals which are captured through analytics signals.

  • A correction will only be proposed if its occurrences in the index corpus are an order of magnitude more prevalent than the original word.

Limitations of the index-based system

This system will ignore keywords that:

  • Are less than four characters long

  • Occur less than five times in the index

  • Contain more than four digits

  • Begin with a digit

  • Contain seven or more consecutive consonants

  • Contain six or more consecutive vowels

  • Contain an invalid number of consecutive vowels, considering the item language

  • Contain wildcard expressions

Features of the QS-based system

  • This system only considers queries which resulted in clicks on search results a specific number of times.

  • Its suggestions are based on the query performance of a potential correction, captured through usage analytics metrics.

  • It considers the degree to which the potential correction matches the typed characters.

Limitations of the QS-based system

Prerequisite

A correctly configured QS model must be configured and available in your Coveo organization. This model will be used to propose the best available correction to users.

Configure the feature

Depending on the Coveo technology that you use to build your search interfaces, see:

If you’re leveraging the Coveo Search API directly, you can use the queryCorrection parameter to enable and control the query correction feature.