--- title: Leverage the Partial match feature slug: '414' canonical_url: https://docs.coveo.com/en/414/ collection: tune-relevance source_format: adoc --- # Leverage the Partial match feature By default, a Coveo [index](https://docs.coveo.com/en/204/) only returns [items](https://docs.coveo.com/en/210/) that match all of the [keywords](https://docs.coveo.com/en/2738/) present in a [basic query expression (`q`)](https://docs.coveo.com/en/178/). 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.[.footnote]^[[1](#item-keywords)]^ This ensures that relevant items containing only some of the [query](https://docs.coveo.com/en/231/) keywords are returned and also reduces the chance of queries returning no results. > **Leading practice** > > Enable partial match on your default [query pipeline](https://docs.coveo.com/en/180/) to ensure that all user queries benefit from this feature. -- 1 The more an item contains keywords from a user query, the higher it will rank in the search results compared to items containing fewer keywords or none. -- ## Set partial match parameters The Partial match feature combines the `partialMatch`, the `partialMatchKeywords`, and the `partialMatchThreshold` query parameters which are set as a [query parameter rule](https://docs.coveo.com/en/3411#partial-match) in a query pipeline.[.footnote]^[[2](#enable-in-search-interface)]^ . On the [**Query Pipelines**](https://platform.cloud.coveo.com/admin/#/orgid/search/pipelines/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/pipelines/)) 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. . On the **Advanced** tab, on the left side of the page, select **Query parameters**. . Click **Add a query parameter rule**. . Under **Parameters**, select **Partial match**, and then click **Next**. . In the **Rule configuration** panel, do the following: * Select whether to enable or disable the partial match. ![Coveo | Partial match](https://docs.coveo.com/en/assets/images/tune-relevance/partialmatch.png) * Under **In a query**, enter the minimum number of keywords that a query must contain to activate the partial match. * Under **In a result**, click **Percentage** or **Absolute number**, and enter the applicable value for the minimum number of keywords that must be present in an item to match the query expression. * Under **Condition**, you can optionally select a [query pipeline condition](https://docs.coveo.com/en/2793/) in the dropdown menu or [create a new one](https://docs.coveo.com/en/1959#create-a-condition). * 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. -- 2. It's also possible, although not typically recommended, to enable partial match through the [search interface](https://docs.coveo.com/en/2741/). See the [`enablePartialMatch`](https://coveo.github.io/search-ui/components/querybox.html#options.enablepartialmatch) option of the [`Querybox`](https://coveo.github.io/search-ui/components/querybox.html) component. -- ## 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 (`q`)](https://docs.coveo.com/en/178/) 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 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](https://docs.coveo.com/en/2741/) will return more results. However, setting the parameters too low can produce a result set that users may perceive as too broad or irrelevant. [Leading Practice] **Leading practice** #### 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](https://docs.coveo.com/en/3255/) and validate whether your new partial match settings are improving the [Search Event Clickthrough](https://docs.coveo.com/en/2041#search-event-clickthrough). #### == Example use case A user is searching for information about their Barca 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`). ## Partial match and stemming Before partial match is evaluated, Coveo applies [stemming](https://docs.coveo.com/en/3436/) to each individual keyword in the query. Stemming reduces a word to its root form and expands the query to include indexed terms that share that root. These expansions count as valid matches when determining whether an item satisfies the `partialMatchThreshold`. The number of required matches, however, are based on the original count of query keywords, not on the number of stem variations generated. For example, with a 6-keyword query and a 50% threshold, an item must match at least three of those keywords (or any of their valid stem expansions) to satisfy partial match. > **Note** > > Stemming only applies to words of at least three characters and only when the word exists in a context where a stem can be derived. > Even in cases where stemming doesn't expand a keyword, partial match continues to count that keyword toward the total number used for threshold calculations. > To learn more about stem expansions, supported languages, and more, see [About stemming](https://docs.coveo.com/en/1576/). ## Limitations When enabled, the Partial match feature doesn't support [exact match phrases](https://docs.coveo.com/en/1686/) (that is, queries that are enclosed within double quotation marks (`""`)). This means that if a query contains a quoted phrase, or if a [thesaurus](https://docs.coveo.com/en/2742/) rule expands a query to include quoted phrases, the Partial match feature considers each term within the phrase separately. **Example** You set the Partial match feature as follows in your query pipeline: * `partialMatchKeywords`: `3` * `partialMatchThreshold`: `50%` 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`