Skip to main content

Partial Word Matching

Partial word matching is what makes search-as-you-type work: a shopper sees results before they finish typing the last word of their query. It is controlled by the prefix attribute.

Not a typo setting

Unlike the other settings in this section, prefix sits at the top level of the search profile, not inside typo_tolerance. It is grouped here because it shapes how partial queries match alongside typo tolerance, but it is configured separately.

Partial Word Matching (prefix)​

The prefix attribute controls whether the last word of the query can match the beginning of a longer word. This is what makes search-as-you-type work: as a shopper types water pr, the partial word pr matches proof before they finish typing.

prefixSearch for water pr matches
true (default)water proof jacket
falseNothing — pr must match a whole word

Only the last query word is treated as a prefix — earlier words must match in full (subject to typo tolerance). A search for wat proof does not prefix-match water proof jacket, because wat is not the last word.

{
"attributes": {
"prefix": false
}
}

Per-Field Prefix Overrides​

Like num_typos, each entry in fields accepts its own prefix value, overriding the profile level for that field. Use this to keep partial matching on names while requiring complete SKUs:

{
"fields": [
{ "name": "name", "weight": 10 },
{ "name": "sku", "weight": 5, "prefix": false }
],
"prefix": true
}

With this profile, the partial query pan matches a product named Panorama, but no longer matches a product whose SKU is panorama. Fields without an override inherit the profile-level prefix.

Ask External AI