WooCommerce search quality depends heavily on how product text is analyzed before it is indexed and searched. Two small but important analysis steps are lowercasing and stemming. Lowercasing makes matching consistent across capitalization differences, while stemming can match related word forms such as shirt and shirts or running and run.
These features are useful for product titles, descriptions, categories, and attributes, but they should be applied deliberately. An analyzer that is too aggressive can produce irrelevant results, especially for brand names, SKUs, model numbers, and technical terms.
What lowercasing does
The lowercase token filter converts alphabetic tokens to lowercase during analysis. For example:
Women's Running Shoes
can be indexed as tokens similar to:
women's<br>running<br>shoes
A search for RUNNING SHOES can then match the same indexed terms as running shoes. Lowercasing is usually safe for natural-language product content because capitalization rarely changes the customer’s intent.
What stemming does
Stemming reduces words to a common stem. Depending on the algorithm, terms such as connect, connecting, and connected may be reduced to related forms. Plurals can also be matched with singular terms.
Stemming is not the same as lemmatization. A stemmer applies language rules that may produce a token that is not a complete dictionary word. This is normally acceptable for matching, but it means stemming should be tested against the vocabulary of the store.
A practical Elasticsearch analyzer
An English analyzer can provide lowercase processing and stemming, but a custom analyzer makes the behavior explicit and easier to maintain. The following example uses a standard tokenizer, lowercase filtering, and the English possessive and stemmer filters:
{
"settings": {
"analysis": {
"filter": {
"english_possessive": {
"type": "stemmer",
"language": "possessive_english"
},
"english_stemmer": {
"type": "stemmer",
"language": "english"
}
},
"analyzer": {
"woocommerce_product_text": {
"tokenizer": "standard",
"filter": [
"english_possessive",
"lowercase",
"english_stemmer"
]
}
}
}
}
}
The possessive filter should run before lowercasing because it is designed to remove the possessive suffix from forms such as men's. The lowercase filter then normalizes case, and the stemmer reduces suitable English terms.
Use the analyzer for natural-language fields
Product names and descriptions are good candidates for lowercase and stemming. A mapping can use the custom analyzer at index time and a matching search analyzer at query time:
{
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "woocommerce_product_text",
"search_analyzer": "woocommerce_product_text"
},
"description": {
"type": "text",
"analyzer": "woocommerce_product_text",
"search_analyzer": "woocommerce_product_text"
}
}
}
}
Using the same analysis rules for indexing and searching is a sensible default. If the search analyzer produces different tokens from the index analyzer, expected matches can disappear. Any change to the index analyzer requires reindexing the affected documents.
Do not stem every WooCommerce field
WooCommerce data contains fields with very different search requirements. Natural-language analysis is appropriate for descriptive content, but exact or keyword-oriented fields should normally remain exact:
- SKU: preserve punctuation, numbers, and letter case behavior according to the store’s SKU policy.
- Brand names: avoid stemming names that resemble ordinary words.
- Model numbers: use a keyword or specialized identifier analyzer rather than an English stemmer.
- Attribute values: decide whether values such as
XL,12V, andwaterproofneed exact filtering, full-text matching, or both. - Product slugs and IDs: keep them as keyword fields for links, filters, and joins.
A common pattern is to map a descriptive field as text with a keyword subfield:
"title": {
"type": "text",
"analyzer": "woocommerce_product_text",
"fields": {
"raw": {
"type": "keyword",
"ignore_above": 256
}
}
}
The analyzed title field supports relevance-ranked searches, while title.raw supports exact sorting, aggregations, and exact-value checks.
Combining full-text search with WooCommerce behavior
Search usually needs more than one matching strategy. A product query can search the analyzed title and description while giving additional weight to exact SKU or exact title matches:
{
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "running shoes",
"fields": ["title^4", "description", "categories^2"],
"type": "best_fields"
}
},
{
"term": {
"sku": "running-shoes-01"
}
}
],
"minimum_should_match": 1
}
}
}
In production, the exact SKU clause should be generated from a normalized SKU value and should not be treated as an analyzed text query. Filters for stock status, catalog visibility, language, price range, and product attributes should normally be placed in the filter portion of a Boolean query so they do not affect relevance scoring.
Test stemming with the analyze API
Before deploying an analyzer, inspect its tokens with Elasticsearch’s Analyze API:
POST products/_analyze
{
"analyzer": "woocommerce_product_text",
"text": [
"Women's running shoes",
"Waterproof jackets",
"Connected lighting"
]
}
Review whether the resulting tokens match the store’s real terminology. Check singular and plural forms, possessives, compound words, brand names, abbreviations, and words that have different meanings in the store’s market. A stemmer that improves searches for apparel may be harmful for electronics or spare parts.
Language and multilingual catalogs
English stemming should not be applied to every catalog. Stemming rules are language-specific, and multilingual stores may need a separate field or index per language. The language can be selected from the WooCommerce product translation or locale during indexing, with the corresponding analyzer used for that content.
For small catalogs, separate language fields can be practical. For larger catalogs, separate language-specific indices can simplify analyzer configuration and relevance tuning. In either design, keep language metadata available for filtering and debugging.
Operational guidance for agencies
- Export a representative set of WooCommerce product titles, descriptions, attributes, SKUs, and categories before choosing an analyzer.
- Compare searches customers actually use, including misspellings, plurals, uppercase input, brand names, and model numbers.
- Use the Analyze API to verify tokens rather than assuming that an analyzer behaves as expected.
- Keep analyzed natural-language fields separate from exact identifiers and filterable values.
- Version index settings and mappings so analyzer changes can be rolled out through a new index and alias swap.
- Reindex after changing tokenization, lowercase behavior, stemming, or field mappings.
- Measure zero-result searches, click-through rates, conversion rates, and searches that lead to no product interaction.
Lowercasing is generally a low-risk normalization step for WooCommerce text. Stemming can substantially improve recall, but it should be limited to fields and languages where its benefits have been demonstrated. Separating analyzed product content from exact commerce data gives agencies a search implementation that is more predictable, testable, and easier to tune.