Taking Advantage of the Partial Match Feature

By default, a Coveo index returns only items matching all keywords present in the basic query expression (q). This behavior helps narrow down the number of results, but may prevent returning relevant items that do not contain one or more of the keywords entered by the end user.

The query pipeline query parameter feature allows you to change the default behavior so that the index can return items that contain only a subset of the keywords (see Adding and Managing Query Pipeline Query Parameters). Partial match enlarges the results set to help prevent rejecting potentially relevant items and reduce chances to get queries returning no results. You can see the partial match feature as allowing end users to enter some irrelevant keywords and still find what they are looking for. Note that items containing all keywords, or more keywords, are likely to rank higher than those which do not.

Enable partial match on your default query pipeline to ensure that end users are usually provided with the partial match feature, assuming they do not meet the condition of a pipeline in which partial match is disabled.

You typically set the partial match parameters as query parameter rules in a query pipeline (see Adding and Managing Query Pipeline Query Parameters).

You can simply enable partial match by setting the partialMatch parameter to true. However, as most of the queries typically contain just a few keywords, with the default values, only those with at least 5 keywords would take advantage of partial matches.

The recommended values of 3 for the partialMatchKeywords and 35% for the partialMatchThreshold parameters typically provide the best results. They are lower than the defaults, allowing for partial match to activate more easily, thus providing a more generous set of results.

The following table illustrates how permissive the recommended parameter values are.

partialMatchKeywords value: 3
Number of keywords in query partialMatchThreshold value: 35%
(Recommended)
partialMatchThreshold value: 50%
(Default)
Minimum number of keywords an item must contain to match Maximum number of absent terms in the item Minimum number of keywords an item must contain to match Maximum number of absent terms in the item
2 Expression too small, partial match disabled 0 Expression too small, partial match disabled 0
3 2 1 2 1
4 2 2 2 2
5 2 3 3 2
6 3 3 3 3
7 3 4 4 3
8 3 5 4 4
9 4 5 5 4

As a comparison, the following table illustrates how permissive the default parameter values are.

partialMatchKeywords value: 5
Number of keywords in query partialMatchThreshold value: 35%
(Recommended)
partialMatchThreshold value: 50%
(Default)
Minimum number of keywords an item must contain to match Maximum number of absent terms in the item Minimum number of keywords an item must contain to match Maximum number of absent terms in the item
2 Expression too small, partial match disabled 0 Expression too small, partial match disabled 0
3 Expression too small, partial match disabled 0 Expression too small, partial match disabled 0
4 Expression too small, partial match disabled 0 Expression too small, partial match disabled 0
5 2 3 3 2
6 3 3 3 3
7 3 4 4 3
8 3 5 4 4
9 4 5 5 4

Thus, reducing the partial match parameter values lower than the recommended values typically causes search interfaces to return significantly more results. However, if the partial match parameters are set too low, end users can perceive the search result set as too broad or irrelevant. When tuning partial match parameter values, always test how each value set affects search results.

Although not the leading practice, you can also enable basic partial match functionality through the Javascript Search Framework by setting the corresponding HTML element attributes of your CoveoSearchbox component.

<div id="searchBox" class="CoveoSearchbox"
     data-enable-partial-match="true"
     data-partial-match-keywords="3"
     data-partial-match-threshold="35%">
</div>