Semantic search is useful when a shopper describes an intent in unfamiliar language. However, WooCommerce catalogs contain many queries where the exact keyword should win. A SKU, model number, plugin name, compatibility code, or regulated product term is not merely a hint about meaning. It is an identifier.
Why semantic similarity can be wrong for product identifiers
Vector search is designed to find text with a similar meaning. That makes it valuable for queries such as “waterproof shoes for winter commuting,” where the shopper may use language that does not appear in the product title.
Identifiers behave differently. Consider these searches:
SKU-AX410-BLKMK-7USB-C PD 65WWooCommerce Subscriptionscompatible with Epson T04D1
A semantically similar result may contain related products but still be unusable. A product with a similar embedding to MK-7 is not necessarily the product whose model number is MK-7. In these cases, a lexical match or an exact structured filter should take priority over vector similarity.
Exact keywords are strongest when the term identifies an object
For WooCommerce agencies, the most reliable rule is to classify the query before choosing the ranking strategy. Exact or lexical retrieval should lead when the query contains a value that customers expect to match literally.
- SKU and variation SKU: Customers, support teams, and warehouse staff often paste these values directly into search.
- Manufacturer part numbers: Part numbers, cartridge codes, and replacement references should not be replaced with semantically related products.
- Model names: Camera bodies, appliances, tools, and electronics often have short model codes that embeddings can confuse.
- Brand and product names: A named product or extension should be found even when its description uses different wording.
- Compatibility terms: Device names, firmware versions, standards, and connector types can be operational constraints rather than descriptive language.
- Regulated or contractual terms: Certification names, license editions, and explicitly supported versions may require literal evidence.
Use lexical search for the first candidate set
Weaviate’s BM25 search is a good fit for keyword-led retrieval. It scores documents using term frequency and inverse document frequency, so a rare product code that appears in a title, SKU field, or part-number field can receive a strong score.
For example, an agency might expose searchable product fields with different weights. A product title and SKU should generally matter more than a long marketing description.
response = collection.query.bm25(
query='SKU-AX410-BLK',
query_properties=['sku^8', 'variation_sku^8', 'name^4', 'part_number^6', 'description']
)
The exact client syntax depends on the Weaviate client version and collection schema, but the ranking principle is stable: index identifier fields explicitly and give them more influence than broad descriptive text.
Use filters when the value must match exactly
BM25 is lexical, not a strict equality operator. It tokenizes text and ranks matching documents, which means it is not sufficient by itself when an exact value is a hard requirement. Store identifiers in dedicated properties and use a filter when the application knows that the query is an identifier.
response = collection.query.fetch_objects(
filters=Filter.by_property('sku').equal('SKU-AX410-BLK'),
limit=20
)
This approach is particularly important for variation-level inventory. A parent product may have the right name while the requested variation is out of stock or has a different SKU. Filtering the variation or offer object avoids presenting a semantically similar but operationally incorrect result.
Exact phrase and exact token are different requirements
“Exact keyword” can describe several different behaviors:
- Exact field equality: The complete stored value must equal the query, such as a SKU.
- Token match: The important words must occur in an indexed field, such as a brand and model combination.
- Phrase preference: The words should appear together or in the requested order, such as a named extension.
- Prefix or normalized match: The value may differ only by formatting, punctuation, case, or a known catalog convention.
Do not describe BM25 as an exact phrase matcher unless your implementation explicitly provides that behavior. Normalize identifiers at ingestion and query time where appropriate, and retain the original display value separately. For example, a normalized field could remove spaces and hyphens for lookup while the original SKU remains available for order and support workflows.
Combine exact and semantic retrieval deliberately
Many storefront searches need both behaviors. A shopper may enter a model number followed by a natural-language requirement, such as “AX410 black replacement filter” or “boots for wet winter trails.” A hybrid strategy can retrieve both literal and semantic candidates, but the exact match should receive a clear business advantage when an identifier is detected.
In Weaviate hybrid search, the alpha value controls the balance between vector and BM25 retrieval. An alpha of 0 is BM25-only, while an alpha of 1 is vector-only. A practical query router can use BM25 or a strict filter for identifier-shaped queries, and use hybrid search for descriptive queries.
if looks_like_sku(query) or looks_like_part_number(query):
results = search_exact_or_bm25(query)
elif is_descriptive_query(query):
results = collection.query.hybrid(
query=query,
alpha=0.35,
query_properties=['name^4', 'brand^3', 'description']
)
The threshold and field weights should come from evaluation rather than guesswork. Test real search logs containing SKU lookups, zero-result searches, support-agent queries, and long natural-language requests.
Make exact matches visible in the final ranking
Retrieval and merchandising are separate concerns. Even if hybrid search returns the right product, the final ranking can bury it beneath popular products, sponsored items, or high-margin alternatives. For identifier queries, apply a controlled boost when the normalized query exactly matches a product or variation field.
A safe ranking policy can look like this:
- Return an exact SKU or part-number match first when it is purchasable and permitted for the current customer.
- Return exact brand-and-model matches next.
- Use BM25 matches for partial or token-level matches.
- Use vector similarity for related or descriptive alternatives.
- Apply stock, channel, price-list, visibility, and compatibility filters before display.
Do not allow an exact match to bypass availability or customer-specific rules. “Exact” should improve relevance, not override catalog governance.
Design the schema around search intent
Search quality is easier to maintain when identifiers are not buried in one large description field. A WooCommerce synchronization process should consider separate Weaviate properties for the product name, brand, SKU, variation SKU, GTIN, manufacturer part number, compatibility references, attributes, categories, and searchable description.
Keep identifiers consistently typed and normalized. Avoid mixing a numeric part number with a numeric price field, and avoid converting values such as 00124 into integers. Leading zeros, hyphens, suffixes, and version markers can be significant.
Measure the cases where exactness matters
Build an evaluation set that includes both successful and dangerous failures. Useful cases include a direct SKU lookup, a partial model number, two similar model numbers, a discontinued variation, a compatibility request, and a natural-language product discovery query.
Track metrics such as exact-match position, variation accuracy, zero-result rate, add-to-cart rate, and searches followed by support contact. A system that improves semantic relevance but sends customers to the wrong replacement part is not an improvement for the store.
For WooCommerce search, exact keywords should win whenever the keyword represents a contractual, operational, or catalog identity. Use Weaviate’s lexical capabilities and structured filters for those cases, then reserve vector similarity for the questions where “similar meaning” is actually what the shopper wants.