Table of contents :

Boosting Product Fields in WooCommerce Search

100-days-of-vespa-ai-woocommerce-026

Table of contents :

WooCommerce search quality depends heavily on how product data is represented and weighted. A product title, SKU, brand, category, attributes, and long description do not have equal commercial value, so treating every field as an undifferentiated text blob usually produces weak results. Vespa lets an agency model these fields separately, match queries across the appropriate field set, and apply field-specific relevance weights.

Separate searchable product fields

Start by mapping WooCommerce data into fields with clear search behavior. Product names and brands should normally contribute strongly to relevance. Descriptions and long-form specifications are useful for recall but should not overpower an exact product or SKU match. SKUs, GTINs, and other identifiers often need exact or near-exact matching rather than ordinary linguistic relevance.

A simplified Vespa document schema might contain fields like these:

field product_name type string {
    indexing: index | summary
    index: enable-bm25
}

field brand type string {
    indexing: index | summary
    index: enable-bm25
}

field description type string {
    indexing: index | summary
    index: enable-bm25
}

field sku type string {
    indexing: attribute | summary
}

field categories type array<string> {
    indexing: index | summary
}

field attributes type map<string,string> {
    indexing: summary
}

The exact schema depends on the data and query patterns. For example, an agency may index selected attribute values as text fields when customers search for phrases such as “waterproof hiking jacket,” while keeping the original attribute map available for filtering and display.

Define the default searchable field set

When the application sends a free-text query through Vespa’s userInput() query operator, a field set controls which fields receive the query terms. A field set prevents accidental searching across internal or low-value fields.

fieldset default {
    fields: product_name, brand, categories, description
}

Do not automatically include every imported WooCommerce field. Stock notes, internal labels, synchronization metadata, and administrative values can introduce irrelevant matches. Include a field only when it provides useful customer-facing search evidence.

Boost fields in the rank profile

Field boosting is primarily a ranking concern. It determines which matching products appear first; it does not necessarily make a document eligible for retrieval. A practical first-phase rank expression can combine BM25 scores from important fields with different weights.

rank-profile product_search inherits default {
    first-phase {
        expression: 6 * bm25(product_name) + 4 * bm25(brand) + 2 * bm25(categories) + bm25(description)
    }
}

This profile gives product names the strongest influence, followed by brands and categories. Descriptions still contribute, but a weak description match is less likely to outrank a product whose name directly matches the query.

These values are starting points, not universal standards. Use search logs and judged result sets to determine whether a brand match should outrank a category match, whether attributes deserve more weight, and how much long descriptions should contribute.

Use exact-match signals for identifiers

BM25 is not always the best signal for SKUs and other identifiers. A query for ABC-123 should strongly favor the product with that exact SKU, even if another product has more textual content. Keep identifier matching separate from general relevance where possible.

One approach is to normalize the incoming query and compare it with an attribute field. For example, the integration can send a normalized SKU as a query property and expose an exact-match feature in the rank profile. The implementation depends on how identifiers are stored, but the principle is consistent: exact identifier equality should produce a deterministic ranking signal.

rank-profile product_search inherits default {
    inputs {
        query(normalized_sku) tensor<float>
    }

    first-phase {
        expression: 6 * bm25(product_name) + 4 * bm25(brand) + 2 * bm25(categories) + bm25(description) + 20 * query(normalized_sku)
    }
}

The example assumes that the application supplies a suitable numeric query feature. In production, define the feature and matching logic according to the chosen Vespa schema and query plan rather than copying the expression unchanged.

Boost WooCommerce attributes carefully

Attributes such as color, size, material, compatibility, and model number often have high commercial value. They should usually be represented both for filtering and for search relevance. A customer searching for “black leather boots” expects products with matching attribute values to rank above products where those words appear only in a generic description.

Consider creating dedicated fields for high-value attributes:

field color type string {
    indexing: index | summary
    index: enable-bm25
}

field material type string {
    indexing: index | summary
    index: enable-bm25
}

field compatibility type string {
    indexing: index | summary
    index: enable-bm25
}

Dedicated fields make weighting and testing easier than placing all attributes into one unstructured string. They also allow the application to distinguish a filter such as color=black from a free-text match on the word “black.”

Combine relevance with business signals

Text relevance should not be the only ranking input for a WooCommerce store. After field-level relevance has produced a sensible candidate order, the rank profile can incorporate controlled business signals such as product availability, popularity, margin, freshness, or conversion rate.

rank-profile product_search inherits default {
    first-phase {
        expression: 6 * bm25(product_name) + 4 * bm25(brand) + 2 * bm25(categories) + bm25(description) + 0.2 * attribute(popularity)
    }
}

Business signals should remain subordinate to strong textual matches unless the business requirement explicitly says otherwise. A highly popular product with no meaningful match for the query should not outrank a relevant product simply because it sells well. Availability is often better handled as a query filter when out-of-stock products must be excluded entirely.

Send queries from the WooCommerce integration

The WordPress or WooCommerce layer should send the customer’s query to Vespa using a stable query template. A typical request uses YQL to retrieve product documents and userInput() to interpret the free-text query against the configured field set.

GET /search/?yql=select * from product where userInput();&query=waterproof hiking jacket&ranking=product_search&hits=24

In an application, construct the request with an HTTP client and encode query parameters rather than concatenating untrusted input into a URL. The WooCommerce endpoint can then transform Vespa hits into product IDs, prices, stock information, and links, or return indexed display fields when the search index is the system of record for those values.

Do not confuse field boosting with query filtering

A boost changes ordering; a filter changes the candidate set. If a customer selects “size 10,” the size constraint should normally be expressed as a filter or structured query condition. Giving the size field a high text weight does not guarantee that every returned product has size 10.

Likewise, category restrictions, visibility rules, catalog permissions, language, and stock requirements should be enforced as filters or document eligibility rules. Keep these constraints separate from relevance weights so that ranking experiments cannot accidentally expose products that should not be returned.

Evaluate boosts with real WooCommerce queries

Use search analytics to build a representative evaluation set. Include exact product names, partial names, SKUs, brand queries, attribute combinations, misspellings, category terms, and queries with no direct product-name match. For each query, record whether the first several results are useful and whether the best available result appears near the top.

  • Test exact SKU and GTIN searches independently from natural-language searches.
  • Compare product-name, brand, category, attribute, and description contributions.
  • Check that long descriptions do not overwhelm concise title matches.
  • Verify that filters still enforce stock, visibility, language, and catalog rules.
  • Measure click-through, add-to-cart rate, conversion rate, and zero-result rate after deployment.

Change one group of weights at a time and compare the result against a baseline. For larger catalogs, use offline relevance judgments or controlled experiments before changing the default rank profile for all shoppers.

Keep field boosts synchronized with the catalog model

Field boosting only works when the index receives complete and current product data. WooCommerce hooks or scheduled synchronization jobs should update the Vespa document when a product title, brand, attribute, category, description, visibility status, or identifier changes. Deletions and unpublishing events require equal attention; stale documents can produce apparently incorrect ranking results even when the rank profile is correct.

For agencies managing several stores, keep the schema and rank-profile configuration versioned with the integration code. Store-specific field availability and business priorities can be represented through separate profiles or query features, while the underlying document model remains consistent enough to operate and test reliably.

Trending posts
You might also like