Taking advantage of the partial match feature
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 reduces the number of results.
However, it may also prevent the index from returning relevant items that don’t contain keywords entered by the user.
The partial match feature allows the index to return items containing only a subset of the keywords entered by the user.[1] This ensures that relevant items containing only some of the query keywords are returned. Enabling partial match also reduces the chance of queries returning no results.
Leading practice
Enable partial match on your default query pipeline to ensure that all user queries benefit from this feature. |
Setting partial match parameters
Partial match parameters are set as query parameter rules in a query pipeline:[2]
-
On the Query Pipelines (platform-ca | platform-eu | platform-au) page, click the query pipeline in which you want to add a rule, and then click Edit components in the Action bar.
-
On the page that opens, select the Advanced tab.
-
In the Advanced tab, on the left side of the page, select Query parameters.
-
In the upper-right corner of the page, click Add rule to access the Add a Query Parameter Rule subpage.
-
Under Parameters, select the appropriate parameter, then click Next.
-
If you selected Partial match, select whether to enable or disable the parameter (for more information on this parameter, see
partialMatch
). -
If you selected Partial match keywords, enter the minimum number of keywords that a query must contain to return partial matches (for more information on this parameter, see
partialMatchKeywords
). -
If you selected Partial match threshold, enter an integer or a percentage value for the minimum number of keywords that must be present in an item to match the query expression (for more information on this parameter, see
partialMatchThreshold
).
-
-
Under Condition, you can optionally select a query pipeline condition in the dropdown menu or create a new one.
-
Under Description, you can optionally enter information to help manage the rule in the future, such as the creation date and the reason for its creation.
-
Click Add rule. The new rule appears at the bottom of the list of the query parameter rules.
How partial match values affect search results
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 basic query expression ( |
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 for partial match parameters, 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 basic query expression (q) 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 parameter even lower, the search interface will return more results. However, setting the parameters too low can produce a result set that 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 the Search Event Clickthrough.
Example use case
A 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 containing at least 6 matching keywords (that is, 50%
of 11 query keywords, rounded up).
However, this will exclude relevant items with 4 or 5 matching keywords that might answer the user’s query (for example, Setting the Weather App to Celsius
).
The alternative partialMatchThreshold
value will return results containing at least 4 matching keywords (that is, 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 user’s query (for example, Installing the Weather App
).
Limitations
When enabled, the partial match feature doesn’t support exact match phrases (that is, queries that are enclosed within double quotation marks (""
)).
This means that if a query contains a quoted phrase, or if a thesaurus rule expands a query to include quoted phrases, the partial match feature considers each term within the phrase separately.
You set the partial match feature as follows in your query pipeline:
A user sends the following query in the search box: HDMI compatible "4K gaming monitor"
Even though the query contains a phrase enclosed within double quotes, it could return results that contain only one of the following terms:
-
4K
-
gaming
-
monitor
enablePartialMatch
option of the Querybox
component.