Query performance best practices

This is for:

Developer
In this article

Various elements have an impact on the query performance. Some factors are directly related to the user query while others are determined by how queries are processed through the Coveo Platform.

The goal of this article is to provide tips to help you optimize query performance.

Search interface

Each search interface sends its own search query. You should avoid having more than one search interface on a single page to avoid sending many queries per user interaction. Instead, you should show all results on a unique search interface and allow your users to filter the content. The best controls to filter content are facets.

Tip

The Atomic library contains several types of facet components. Embed Atomic facet components in an atomic-facet-manager component to add Dynamic Navigation Experience (DNE) to your search interfaces.

Query scope

The scope of a query corresponds to the subset of the index that’s concerned by this query. The larger the scope is, the higher the load on the index is and the longer it takes to return results. Additionally, some complex query filters are longer to execute than simple ones.

Tip
  • Avoid using query filters to remove irrelevant items from the search results. Instead, remove these items from the index using inclusion or exclusion rules if they should never be returned in the search results.

  • Don’t expand your queries using wildcards. Processing wildcards is extremely heavy on the index and has absolutely no advantage over Coveo Machine Learning and context-based relevance boosting.

  • Avoid using wildcard, REGEX, phonetic, or fuzzy match filter expressions if you don’t really need them. They’re heavy on the index.