Table of contents :

Exact Match vs Partial Match

100-days-of-algolia-026

Table of contents :

Search behavior has a direct effect on product discovery, conversion rate, and support volume in WooCommerce stores. A shopper searching for hoodie should usually find hoodies, while a shopper searching for a highly specific SKU may expect only an exact result. Algolia can support both behaviors, but exact and partial matching solve different problems and should not be treated as interchangeable.

What exact matching means in Algolia

Exact matching means that the query term matches a complete indexed word or a deliberately constrained query expression. For example, a search for SKU-4812 should favor a product containing that complete identifier rather than products containing only a similar prefix.

In Algolia, exactness is primarily influenced by the engine’s ranking and matching configuration. The exact ranking criterion helps rank records where the query words match exactly. It does not mean that every search automatically becomes a strict equality test. Typo tolerance, stemming-related behavior, synonyms, prefix matching, and other ranking criteria can still affect the result set.

Exact matching is especially useful for:

  • SKU and part-number searches
  • Brand names with important spelling distinctions
  • Model numbers and product variations
  • Internal catalog codes used by customer service teams
  • Queries where returning a broader result would create operational risk

What partial matching means in Algolia

Partial matching allows a query to match part of a word, most commonly a word prefix. This is valuable while a shopper is still typing. A query such as run sho can begin returning products containing words such as running and shorts, depending on the configured query type and indexed content.

Algolia’s queryType parameter controls prefix behavior:

  • prefixLast applies prefix matching to the last word in the query. This is a common choice for search-as-you-type interfaces.
  • prefixAll applies prefix matching to every word in the query.
  • prefixNone disables prefix matching and requires complete query words, subject to other matching features.

For most WooCommerce autocomplete experiences, prefixLast provides a useful balance. It allows the shopper to complete the current word without making every earlier word behave like an unrestricted partial match.

Exact versus partial matching in a WooCommerce catalog

Consider a store selling replacement bicycle components. A shopper entering chain may want chains, chainrings, chain tools, and chain lubricants. Partial or broad word matching is appropriate because the query expresses a product concept.

Now consider a shopper entering BB-6805. Returning products for BB-6805-2RS may be useful if those products are compatible variants, but returning every bearing with a similar numeric fragment can create confusion. The search experience should distinguish a product-code workflow from a category-discovery workflow.

A practical strategy is to use the same Algolia index with carefully designed ranking and searchable attributes, or to use separate experiences for general product search and SKU lookup. Do not attempt to make one global setting behave perfectly for both use cases.

Configuring query behavior

A typical WooCommerce product search can use prefix matching for autocomplete while retaining exact matches as a stronger relevance signal:

{"query":"hood","queryType":"prefixLast","typoTolerance":true}

For a stricter lookup interface, use prefixNone and consider disabling typo tolerance when a code must be entered precisely:

{"query":"SKU-4812","queryType":"prefixNone","typoTolerance":false}

Whether typo tolerance should be disabled depends on the data. It is often helpful for ordinary product names, but it can produce undesirable substitutions for short identifiers, serial numbers, or codes where one character changes the product.

Use searchable attributes to control scope

Matching quality depends heavily on what is indexed as searchable content. A WooCommerce implementation should normally give product names and carefully selected SKU fields higher priority than long descriptions or unstructured metadata.

searchableAttributes: [<br>  "unordered(name)",<br>  "sku",<br>  "brand",<br>  "categories",<br>  "unordered(description)"<br>]

Attribute order affects relevance. If a SKU is searchable but buried below a long description, a broad partial match in the description may outrank the exact code match. Agencies should test the complete ranking configuration rather than evaluating exact matching in isolation.

Phrase searches and advanced syntax

Some stores need shoppers to search for a phrase such as leather wallet rather than matching the words independently. Algolia’s advanced syntax features can support phrase and exclusion use cases when enabled and implemented in the frontend. For example, a phrase-aware search can be useful when the order and proximity of terms matter.

Do not expose advanced syntax without deciding how it will interact with the storefront search box. If shoppers can enter operators, document the behavior in the interface or normalize user input before sending the query. A search box intended for casual shoppers should not unexpectedly interpret punctuation as an operator.

WooCommerce implementation considerations

Separate autocomplete from results pages

Autocomplete generally benefits from prefixLast, a small result limit, and a compact projection of product data. The full results page can use a broader configuration, facet filters, merchandising rules, and a different ranking balance.

Preserve exact SKU visibility

Include SKU in the indexed record and display it in the result when a code-like query is detected. This helps shoppers verify that the returned product is the intended item. A custom ranking signal or a dedicated SKU search path may be appropriate for stores where code lookup is a major workflow.

Normalize catalog data before indexing

Normalize case, whitespace, punctuation, and SKU formatting consistently. Decide whether values such as AB-123 and AB123 should be treated as equivalent, then implement that decision during indexing rather than relying on accidental matching behavior.

Be cautious with synonyms

Synonyms improve discovery for terms such as sneakers and trainers, but they weaken the meaning of a strict lookup if applied indiscriminately. Keep product-language synonyms separate from code and model-number logic.

How to test exact and partial behavior

  1. Create a test catalog containing similar product names, variants, SKUs, typos, plurals, and overlapping prefixes.
  2. Test incomplete queries such as hood, run sho, and wirel.
  3. Test complete product terms such as hoodie and wireless.
  4. Test identifiers such as SKU-4812, including missing punctuation and one-character errors.
  5. Compare rankings with prefixLast, prefixNone, and the chosen typo-tolerance settings.
  6. Measure zero-result searches, refinement usage, add-to-cart rate, and search-to-purchase conversion separately for general terms and identifiers.

The goal is not to choose exact matching or partial matching globally. The goal is to make the matching behavior reflect shopper intent. Broad, incomplete queries should help shoppers discover products, while precise names and identifiers should reward exact results and avoid noisy substitutions.

Trending posts
You might also like