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 Parameter type to override, select Query.
-
In the Parameter name input, enter the name of the parameters to override. To enable the partial match feature, you have to create a rule for each of the following parameters:
-
partialMatch
- You enable partial match by setting this parameter totrue
. -
partialMatchKeywords
- The minimum number of keywords that a query must contain to return partial matches (the default is5
query keywords). -
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 is50%
of the query keywords).
-
-
Under Parameter type, select one of the supported parameter value types: String, Number, or Boolean, depending on the parameter you’re working with.
-
For
partialMatch
, select Boolean. -
For
partialMatchKeywords
, select Integer. -
For
partialMatchThreshold
, select String.
-
-
On the right side, under Condition, you can optionally select a query pipeline condition in the dropdown menu or create a new one.
-
Under Description, optionally enter information to help you manage the rule in the future such as the creation date and the reason why you create it.
-
Click Add rule.
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.