Back to Blog
Part VI · Chapter 19e-commerceapplied

E-Commerce Hybrid Search: Semantic Meets Structured Filtering

A product query like 'red running shoes under $120' mixes semantic intent with exact filtering. Neither pure keyword nor pure vector search handles that, and hybrid is only a partial answer.

December 15, 20256 min read

A query for "red wine $40" on a major retail platform once returned shoes (color: "wine red") and pants (waist size: 40). That single incident captures why product search is hard: the query mixes a semantic concept with structured constraints, and a pure embedding pipeline conflates the two. It is also why hybrid search has more measurable revenue impact in e-commerce than almost anywhere else, and why the off-the-shelf version fails so visibly. For adjacent topics, see the chapter index.

Products are semi-structured, queries are not

A product is a semi-structured record: free-text fields (title, description, reviews) plus typed attributes (price, brand, category, color, availability, rating). A query like "red running shoes under 120"hasasemanticcomponent("runningshoes,"whichmustmatchdescriptionsthatmightsay"lightweighttrainer"or"athleticfootwear")andexactfilteringconstraints("red,""under120" has a semantic component ("running shoes," which must match descriptions that might say "lightweight trainer" or "athletic footwear") and exact filtering constraints ("red," "under 120"). Treating the whole query as a single embedding and running vector similarity against concatenated product text loses the structured constraints. Treating it as a pure keyword query loses the semantic bridging.

The stakes are well documented. Synonym failures affect 70% of e-commerce search implementations, where queries using product-type synonyms return irrelevant or empty results, and 31% of product-finding tasks fail outright when users rely on site search (Baymard, 2024). Searchers are roughly 24% of visitors on many platforms but drive 44% of revenue, which puts "red wine" failures directly on the P&L.

The architecture that actually works

The production e-commerce pipeline is a specialization of the general hybrid architecture. The core stages are the same: query understanding, parallel retrieval, fusion, reranking. The domain-specific adaptations happen at every stage.

Query understanding extracts structured attributes: brands, product types, price constraints, and colors become hard filters, and the remaining free text goes to the retrieval path. Retrieval combines BM25 on tokenized text with vector similarity on product descriptions, with attribute filters applied on both paths. Reranking incorporates business signals (margin, inventory, promotion status, personalization) alongside relevance. Evaluation ties back to conversion and revenue, not just NDCG.

Menon et al. (2025) showed on the Amazon Toys Reviews dataset (around 10,000 items, a single category) that decomposing queries into structured metadata tags and semantic elements, then applying metadata filtering before semantic retrieval, reached mAP@5 of 52.99%, ahead of BM25, dense similarity, cross-encoder reranking, and hybrid fusion via RRF. The dataset is narrow. The mechanism is what generalizes: treating extracted attributes as hard constraints means the system filters to a specified brand before computing semantic similarity, rather than hoping the embedding space separates brands cleanly.

Pre-filter vs post-filter at catalog scale

The pre-filter vs post-filter decision is where e-commerce vector search breaks in ways the general hybrid literature underplays. The intuition runs backwards from what most teams assume.

Pre-filtering restricts the candidate pool before running ANN, and fails on highly selective (narrow) filters. "Available Sony headphones under $100" might match 0.1% of the catalog, and when the HNSW graph is restricted to that subset it loses connectivity; the search degenerates toward brute force and latency spikes. Correctness is preserved, efficiency is not. Post-filtering runs an unrestricted ANN query and discards non-matching results afterward, and fails in the opposite regime: when the filter is narrow and selectivity is low, a top-1,000 ANN pass yields maybe ten matching products, so the result page is a sparse, biased sample of what the user actually qualifies for. The symptom is quiet: the page renders, but the relevant set has been silently truncated.

The cost of getting this wrong is large. Filter-aware graph methods like ACORN reach roughly 30 to 50 times the QPS of naive pre- or post-filtering at 0.9 recall on real datasets (Patel et al., 2024). Mature platforms do not pick one path; they estimate selectivity per query and route accordingly, and the decision logic itself is where the engineering lives. This trade-off gets re-tuned as the catalog evolves, which is why drift monitoring belongs in the e-commerce stack even more than in a general search context.

Open questions the chapter answers

Three questions follow from the above, and none of them has a default answer that transfers cleanly across platforms. Where should attribute extraction live, given that the extracted structure feeds both filtering and ranking and has to stay consistent across the two? How do you connect search-quality metrics to revenue when one study finds 97% agreement between NDCG and online outcomes at Amazon and another finds Pearson r = -0.1 between offline proxies and business value at Booking.com? What signals does an e-commerce reranker need that a generic search reranker does not, once margin, inventory, promotions, and personalization all sit on top of relevance?

The reconciliation between the Amazon and Booking.com numbers, the decision table for pre-, post-, and joint filter-aware ANN across selectivity zones, the ESCI relevance structure that makes "relevance" itself more than binary, and the revenue attribution formula that turns a conversion-rate lift into a dollar figure are what the chapter carries. Each looks like a tuning problem until you try to ship it, at which point it turns into an architectural decision with revenue attached.

Related chapter

Chapter 19: E-Commerce Product Search

A product catalog is not a document corpus: each product is a semi-structured record of free-text fields plus typed attributes, and a query like "red running shoes under $120" mixes natural-language intent with hard filter conditions. This chapter works through how to weave semantic retrieval together with attribute filtering, resolve the pre-filter versus post-filter tension at catalog scale, layer personalization onto the ranking stack, and tie relevance metrics directly back to conversion and revenue.

Get notified when the book launches.

L

Laszlo Csontos

Author of Designing Hybrid Search Systems. Works on search and retrieval systems, and writes about the engineering trade-offs involved in combining keyword and vector search.