Taking Advantage of the Partial Match Feature

By default, a Coveo index only returns items that match all of the keywords present in a basic query expression (q). This behavior helps to narrow down the number of results, but it may also prevent the index from returning relevant items which don’t contain one or more of the keywords entered by the end user.

The partial match feature allows the index to return items that only contain a subset of the keywords entered by the end user.1 This ensures that relevant items which only contain some of the query keywords are returned, and reduces the chance of receiving no results in the response.

Enable partial match on your default query pipeline to ensure that all end user queries benefit from this feature.

1: Items containing all of the keywords, or those which contain more of them, are likely to rank higher than those which contain fewer keywords.

Setting Partial Match Parameters

Partial match parameters are set as query parameter rules in a query pipeline:1

  • partialMatch - You can enable partial match by setting this parameter to true.

    partialmatch

  • partialMatchKeywords - The minimum number of keywords that a query must contain to return partial matches (the default is 5 query keywords).

    partialmatchkeywords

  • partialMatchThreshold - The minimum number of keywords that must be present in an item to match the query expression. This can be an integer or a percentage value, with fractions rounded up (the default is 50% of the query keywords).

    partialmatchthreshold

The following table illustrates how the default partial match values affect search results.

Number of keywords in query Minimum number of keywords an item must contain to match
4 The expression is too small, so partial match doesn’t apply.
5 3
6 3
7 4

However, as queries often contain just a few keywords, the default values may be too restrictive. In some scenarios, you might prefer to set lower values, such as 3 for partialMatchKeywords and 35% for partialMatchThreshold. These values are more permissive than the defaults, allowing for more partial matches and providing a more generous set of results.

The following table illustrates how these alternative values affect search results.

Number of keywords in query Minimum number of keywords an item must contain to match
2 The expression is too small, so partial match doesn’t apply.
3 2
4 2
5 2
6 3
7 3

If you set the partial match parameters even lower, the search interface will return more results. However, setting the parameters too low can produce a result set that end users may perceive as too broad or irrelevant.

When tuning the partial match parameter values, you should always test how each value affects the search results.

For example, you can set up an A/B Test and validate whether your new partial match settings are improving your Search Event Click-Through.

1: It’s also possible, although not typically recommended, to enable partial match through the search interface. See the enablePartialMatch option of the Querybox component.

Example Use Case

An end user is searching for information about their Speedbit product using the following query:

how do I change weather app settings from Fahrenheit to Celsius

How partialMatchKeywords Affects the Results

The above query contains 11 keywords. If partialMatchKeywords is set to either the default (5) or alternative (3) value, partial match applies because the length of the query exceeds both values.

As long as partialMatchKeywords has a value of 11 or less, partial match will apply to this query.

How partialMatchThreshold Affects the Results

The default partialMatchThreshold value will return results that contain at least 6 matching keywords (i.e., 50% of 11 query keywords, rounded up). However, this will exclude relevant items with 4-5 matching keywords that might answer the end user’s query (e.g., Setting the Weather App to Celsius).

The alternative partialMatchThreshold value will return results that contain at least 4 matching keywords (i.e., 35% of 11 query keywords, rounded up).

If you set partialMatchThreshold to 15%, you’ll receive partial matches with only 2 matching keywords. This may return results that aren’t relevant to the end user’s query (e.g., Installing the Weather App).

Recommended Articles