Table of contents :

Why the Order of Searchable Attributes Matters

100-days-of-algolia-028

Table of contents :

In Algolia, the order of searchableAttributes is part of the relevance strategy. It tells Algolia which product fields should receive priority when a query matches more than one attribute. For a WooCommerce catalog, placing the product title before the description can make the difference between a useful result set and a list dominated by incidental keyword matches.

How searchable attribute order affects ranking

Consider a search for leather wallet. The terms might appear in a product title, brand, category, SKU, short description, or long description. If all of those fields are searchable, Algolia still needs to determine which matches are most important.

With the default attribute ranking behavior, attributes listed earlier in searchableAttributes have higher priority than attributes listed later. A match in a product title should generally outrank a match found only in a long description, so the configuration should reflect that business expectation.

[
  "title",
  "brand",
  "categories",
  "sku",
  "short_description",
  "description"
]

In this example, a title match is prioritized over a brand match, and a brand match is prioritized over a description match. The exact ranking result also depends on other ranking criteria, such as typo tolerance, proximity, custom ranking, filters, and text relevance.

Why this matters for WooCommerce catalogs

WooCommerce product data often contains duplicated or unevenly maintained text. A product name may contain the core buying terms, while the description includes technical specifications, compatibility notes, shipping information, and marketing copy. If the description is placed too early, products can rank highly because a low-value phrase happens to occur in a large block of content.

For most stores, a practical priority order is:

  1. Product title: The clearest signal of what the product is.
  2. Brand or manufacturer: Important for brand-led searches.
  3. Product type and categories: Useful for broader product discovery.
  4. SKU and model number: Essential for precise lookup, but usually less important for general searches.
  5. Short description: Often more curated than the full description.
  6. Full description: Valuable for discovery, but more likely to contain incidental matches.

This order is not universal. A B2B parts store may need model numbers near the top, while a fashion retailer may give more weight to brand, collection, color, and style attributes.

Using ordered and unordered attributes

Algolia supports modifiers that change how matches within an attribute are evaluated. For example:

[
  "title",
  "brand",
  "unordered(categories)",
  "unordered(description)"
]

The unordered() modifier prevents the position of the matching words within that attribute from affecting relevance. This is useful for long descriptions or category values where the words may appear in different positions without changing the meaning.

unordered() does not make the attribute equal to every other attribute. The position of the attribute in the searchableAttributes array still matters. unordered(description) remains lower priority than title when the title appears first in the configuration.

Choosing an order for common WooCommerce fields

A store selling consumer products might use a configuration like this:

[
  "unordered(title)",
  "brand",
  "product_type",
  "categories",
  "sku",
  "short_description",
  "unordered(description)"
]

A store selling replacement parts may need a different order:

[
  "sku",
  "part_number",
  "unordered(title)",
  "brand",
  "product_type",
  "categories",
  "unordered(description)"
]

The second configuration supports users who search by an exact or partial part number. Agencies should avoid copying one attribute order across every client because the best order depends on how customers identify products and how the catalog is maintained.

Do not combine unrelated fields too early

It is possible to combine multiple fields into a single searchable attribute, but doing so can remove useful distinctions between them. For example, placing title, SKU, brand, and description into one combined field may make indexing simpler, but Algolia can no longer treat a title match differently from a description match within that field.

Keep commercially meaningful fields separate when their priority should differ. Use combined fields only when the business treats those values as one search layer or when the implementation has a specific reason to simplify the index.

Testing attribute priority with representative queries

Changing attribute order should be treated as a relevance change, not a cosmetic configuration update. Before deploying a new order, create a test set based on real WooCommerce searches, including:

  • Exact product names.
  • Brand and product type combinations.
  • SKU and model-number searches.
  • Generic category searches.
  • Queries where a term appears in the description but not the title.
  • Queries containing spelling mistakes or multiple terms in different orders.

For each query, record which products should appear in the first few positions and why. Then compare the results before and after changing searchableAttributes. A useful test is to create two products where the query appears in the title of one product and only in the description of another. The title match should normally win if the attribute order reflects the intended experience.

Operational considerations for agencies

When managing Algolia for WooCommerce clients, store the attribute order in version-controlled configuration rather than editing it informally in the dashboard. Document the reason for each priority, especially when SKU or custom product fields are ranked above the title.

Also verify that the values are actually present in the indexed records. A carefully ordered field has no effect if the WooCommerce-to-Algolia indexing process uses a different attribute name, omits variable-product data, or sends empty values. Inspect indexed records and confirm the final searchableAttributes setting on the production index.

After changing the setting, reindex when the field structure or indexed data has changed, and validate the live frontend against the correct index and replica. If the implementation uses replicas for sorting or merchandising, apply the intended relevance configuration consistently and test each search experience.

Practical configuration checklist

  • Put the strongest customer-facing identifier first.
  • Keep title, brand, category, SKU, and description fields separate when their priorities differ.
  • Use unordered() for long text where word position is not meaningful.
  • Do not assume every WooCommerce store needs the same field order.
  • Test exact, broad, SKU, brand, and description-only queries.
  • Confirm that configured attribute names match the indexed Algolia records.
  • Review relevance changes with client stakeholders before publishing them.
Trending posts
You might also like