A visitor types "light jacket for autumn" into your search bar. The engine shows three winter parkas and an umbrella, even though you have twenty windbreakers in stock. Nobody misconfigured anything: the algorithm simply did what it was built to do.
You don't need to know how to code a search engine to understand its logic. But once you do, you can diagnose a search problem in minutes, and you stop choosing your tool on the strength of a sales brochure alone.
- There are four main families: keywords (BM25), semantic (embeddings), hybrid, and behavioural ranking.
- Keywords are precise on exact SKUs but blind to synonyms. Semantic search understands meaning but stumbles on product codes.
- Hybrid search merges the two. It is the approach used by modern engines.
- Behavioural ranking doesn't change which products come up, but in what order, based on clicks and purchases.
- Whatever the algorithm, industry synonyms and complete product data remain the most cost-effective settings.
What happens between typing and results
An e-commerce search engine does two things in sequence. First, it finds candidates: every product that could answer the query. Then it ranks them, to decide which ones appear at the top of the page.
The four families of algorithms come in at different points of that journey. Keywords and semantic search find candidates, hybrid search merges their lists, and behavioural ranking reorders the whole thing.
All modern engines combine these approaches. What sets them apart is the balance between them and how much tuning they leave in your hands.
Keywords (BM25): precise on what is written
This is the historical mechanism of search. The engine compares the terms typed by the visitor with those in your product pages. The TF-IDF model dates back to the 1970s; BM25 (Best Match 25), its improved version from the 1990s, is the reference today.
BM25 looks at three things: how often a word appears in a product page, how rare it is across the whole catalog, and the length of the text (a word in a short title weighs more than one buried in a long description). Most engines add a per-field weight: a word in the title counts more than a word in the description.
Take a sports store with 4,000 products. The word "shoes" appears in 1,200 product pages, "trail" in 40. For the query "trail shoes", BM25 gives far more weight to "trail": the rare word does the sorting. The 40 pages that contain it rise to the top, and among them, those with the word in the title come first.
Its strengths are real: it is fast, transparent (you can always tell why a product shows up) and very reliable on exact references, such as "XYZ-4521" or a model name.
Its limit is just as clear: it only knows the words that are written. "Running trainers" won't bring up your "sneakers" if the word "trainers" isn't in the product page. "Waterproof trousers" won't find the "softshell pants". And a sentence like "something warm for hiking" often ends on a zero-results page.
Stuffing descriptions with keywords to "help" BM25 ("trainers, sneakers, running shoes, kicks...") hurts relevance: the most stuffed pages rise on queries that have nothing to do with them. The right place for these equivalences is the engine's synonym list.
Semantic search: understanding what is meant
Instead of comparing words, semantic search compares meanings. Each product and each query is converted into a vector: a series of numbers representing its meaning, in a space of several hundred dimensions. Searching then means finding the products whose vector is closest to the query's.
These vectors, called embeddings, are produced by language models trained on very large volumes of text. They "know" that "parka" and "winter coat" are close, that "sneakers" and "trainers" mean the same thing, and that a query about warmth and hiking calls for down jackets and technical shells. Our article on vector search explains the mechanics in detail.
In the same sports store, "something warm for winter" brings up down jackets, beanies and fleeces, even though none of those words are in the query. Conversely, "ref XYZ-4521" may return three neighbouring references before the right one: for a vector, two codes that look alike have almost the same meaning.
Semantic search also copes better with rephrasing and some typos. The trade-offs: it is less precise on codes and exact references, and indexing takes more computing power, since a vector has to be produced for every product.
Hybrid search: two lists merged
Hybrid search runs the query through both methods in parallel, then merges the results into a single ranking. It keeps the precision of BM25 on references and the semantic understanding of meaning.
There are two common ways to merge. Either a weighting of the two scores, often set by a parameter called alpha (for example 0.5 for equal weight). Or a rank-based fusion (Reciprocal Rank Fusion, or RRF), which rewards products that rank well in both lists.
With rank-based fusion, a product ranked 2nd on keywords and 5th on semantics beats a product ranked 1st on one side but missing from the other. When you see an "average everywhere" product outrank a champion of a single method, it isn't a bug: hybrid search favours consensus.
It has become the standard for recent engines. Elasticsearch lets you combine lexical and vector search in its version 8 releases, Algolia offers it with NeuralSearch, and Google Vertex AI Search for Retail combines query understanding with word matching. The trade-off: trickier tuning and heavier infrastructure if you host it yourself.
Behavioural ranking: order learned from your customers
This fourth family doesn't change which products are found, but in what order they are displayed. The engine watches what your visitors do after a search (clicks, add-to-carts, purchases) and adjusts the ranking to promote the products that best answer each type of query.
If shoppers searching for "beginner running" mostly click on and buy one particular model, that model rises for that query, with no manual setting. You will also see it called ML ranking or learning to rank.
Behavioural ranking amplifies existing trends. A product with little visibility at the start gets few clicks, so it stays out of sight. New arrivals, promotions and end-of-line items need a manual push: that is the job of searchandising (boosting, featuring).
Another limit: at launch, there is nothing to learn from. This is the cold start problem. It needs enough data for the signal to be reliable, and it acts first on the most frequent queries.
The four approaches side by side
The table sums up what each family brings, what it misses, and what it needs to work.
| Algorithm | Strengths | Main limits | Data required |
|---|---|---|---|
| BM25 / TF-IDF | Precise on exact references, fast, transparent | Ignores synonyms and natural language | None beyond product pages |
| Semantic | Understands meaning, sentences, rephrasing | Less reliable on exact codes and SKUs | An embedding model (pre-trained) |
| Hybrid | Precision plus understanding, fewer zero results | Balance between the two methods hard to tune | An embedding model |
| Behavioural ranking | Adapts to your audience, keeps optimising the order | Cold start, amplifies best-sellers | Clicks and purchases in sufficient volume |
These differences show up in research. Baymard Institute measured, query type by query type, the share of e-commerce sites whose search fails:
Exact queries, the natural territory of keywords, are handled best. Use-case queries ("jacket for running in the rain") fail on more than four sites out of ten: these are precisely the ones that require understanding meaning.
Test your search engine in ten minutes
No need to ask your provider which algorithm they use: your search bar will tell you. Type one query of each type below, replacing the examples with products from your own catalog.
| If the engine fails on... | Likely cause | How to fix it |
|---|---|---|
| 1 (exact reference) | Semantic only, no keyword layer | Move to a hybrid engine, index the codes |
| 2, 6 (synonym, abbreviation) | Keywords only | Synonym list, then a semantic engine |
| 3, 4 (typo, plural) | No typo tolerance or normalisation | Turn on spell correction |
| 5, 8 (use case, sentence) | No understanding of meaning | Semantic or hybrid engine |
| 7 (non-product) | No redirect set up | Redirect to your help pages |
Don't stop at "results are showing". Look at the top three: on mobile, that is often all the visitor sees. An engine that returns 200 products with nothing relevant at the top fails just as much as an empty page. Your no-results pages also deserve their own treatment, covered in our article on zero-result pages.
Which combination for your store?
The answer depends on catalog size, traffic and how rich your product data is. The thresholds below are guidelines, not hard boundaries.
- Small catalog (under 1,000 products): a well-tuned keyword engine with up-to-date synonyms can be enough. A semantic layer becomes worthwhile when failed queries start to add up.
- Medium to large catalog (1,000 to 50,000 products): hybrid search quickly becomes essential. Between variants, brands and phrasings, a manual synonym list can no longer cover everything.
- High-traffic site (over 50,000 visitors a month): behavioural ranking brings continuous improvement without intervention. There needs to be enough data for it to converge on a reliable signal.
- In every case: industry synonyms remain the most cost-effective short-term setting. Cheap to set up, with an immediate effect on searches with no results.
- Test the engine with your customers' real queries
- Fill in brand, color and material in dedicated fields
- Review searches with no results every month
- Choosing a tool just because its brochure says "AI"
- Relying on behavioural ranking to launch a new product
- Stuffing descriptions with loose keywords
What Vectail does with these algorithms
Vectail is built on Google Vertex AI Search for Retail. Google doesn't publish the details of its models, but its documentation describes an engine that combines query understanding, matching against catalog attributes and user events. You don't have to choose or calibrate the balance between keywords and meaning: Google's infrastructure handles it.
- Automatic query expansion: every search is sent with the
queryExpansionSpec: AUTOparameter, which lets the engine broaden the query to related terms when exact results are thin. - Behavioural signals: your visitors' searches and clicks are sent to Vertex AI as events, without cookies. Google uses them to refine results, and the signal builds up as traffic grows.
- Industry synonyms from the dashboard: for "MTB" and "mountain bike", or "parka" and "coat", you create a group and pick the term used in your catalog. Vectail rewrites the query to that term before sending it to the engine.
- Autocomplete that learns: suggestions are enriched by the queries actually typed on your site.
An honest limit: you don't set the weight between keywords and semantics yourself. If your tech team wants to control every dial, an engine like Elasticsearch gives more control, at the cost of development and maintenance on your side. To go further on Google's engine, read our article on Google Vertex AI Search for Retail.
Your checklist
- 8-query test set run on your current engine
- Top three results checked on mobile, not just whether results appear
- Exact references found (if not: keyword layer missing)
- Synonyms and use cases found (if not: semantic layer missing)
- Industry synonym list created, including your sector's abbreviations
- Attributes (brand, color, material, size) filled in dedicated fields
- New arrivals and promotions boosted manually
- Searches with no results reviewed every month
Frequently asked questions
What is the difference between BM25 and semantic search?
BM25 compares the words typed with the words in your product pages: it is very accurate on an exact SKU or model name, but finds nothing when the shopper uses a different word from yours. Semantic search compares the meaning of the query with the meaning of each product using vectors: it understands synonyms and full sentences, but it is less reliable on product codes.
Is hybrid search always better?
It covers more cases, since it combines the precision of keywords with an understanding of meaning. On a small catalog with simple vocabulary, a well-tuned keyword engine with a synonym list can be enough. Hybrid search really pays off when the way shoppers phrase things drifts away from the wording of your product pages.
Do you still need synonyms with a semantic engine?
Yes, for the vocabulary specific to your trade: abbreviations, product line names, technical or regional terms. A general-purpose model knows everyday language, not necessarily the jargon of your sector. Synonyms remain the cheapest setting and the quickest to pay off.
How much traffic does behavioural ranking need to work?
There is no universal threshold. Frequent queries need to collect enough clicks and purchases for a signal to emerge. As a rule of thumb, the effect becomes noticeable from a few tens of thousands of visitors a month; below that, it mainly acts on the most frequent queries.
Sources
- Baymard Institute, Ecommerce Search UX Best Practices, 2026.
Let Vectail handle the algorithms for you
Search powered by Google Vertex AI, behavioural signals and industry synonyms managed from a single dashboard. Your catalog is imported from Google Merchant Center, and the engine installs with one line of code, no plugin.
Start for free - 14-day free trial, no credit card