Search is often the most valuable and most neglected feature in a product. Visitors who use search are typically far more likely to convert than those who browse, yet many sites still rely on a basic database query that fails on typos, ignores synonyms and returns results in arbitrary order. Recommendations are similar: "customers also viewed" boxes drive engagement and revenue when done well and clutter when done badly. Advances in embeddings and language models have made much better search and recommendations achievable for ordinary products. This guide explains the options and how to build sensibly.

Start with what your users are trying to do
Review the queries people already type. Which return nothing? Which produce results people ignore? Which are questions in natural language ("waterproof jacket for cycling in rain") rather than keywords? Log searches, zero-result rates, click positions and follow-up actions. This data tells you whether you need better typo tolerance and filters, semantic understanding, or better content. Without it, you risk building sophisticated technology for a problem you do not have.

Level one: a proper full-text engine
Dedicated search engines and modern database full-text features provide tokenisation, stemming (matching "running" to "run"), typo tolerance, synonyms, phrase matching, field boosting (a title match counts more than a description match), filters and facets. They are fast and mature, and for many catalogues and document libraries this alone delivers a large improvement over naive queries. Tune the basics: index the right fields, define synonyms for your domain, handle plurals and abbreviations, and show good snippets and highlighted matches. Speed matters, and your search should respond in tens of milliseconds; see our database optimisation guide and our caching guide.
Level two: semantic search with embeddings
Embeddings convert text (or images) into numeric vectors so that items with similar meaning sit close together. Search then becomes finding the nearest vectors to the query's vector, which lets "cheap flights to somewhere warm" match a page about budget beach holidays even when no words overlap. It shines for natural-language queries, support content, long documents and cross-language matching. Its weaknesses are exact identifiers, model numbers and rare terms, where keyword matching remains better. We explain the storage side in our vector database article.
Level three: hybrid search and re-ranking
The strongest systems run keyword and vector retrieval together and merge the results, using techniques such as reciprocal rank fusion or weighted scores. A re-ranker, a more expensive model that examines the top few dozen candidates against the query, then orders them precisely. Business rules layer on top: promote in-stock items, boost margin or freshness, demote out-of-stock or duplicate results, respect user permissions. Design for graceful behaviour: if the semantic component is down, keyword search should still work.

Understanding queries
Much of the improvement comes before retrieval. Spell correction, query expansion with synonyms, detecting filters in the text ("under $50", "red", "size 10"), identifying intent (looking for a product, a help article or an order status) and handling ambiguity all help. Language models can rewrite or classify queries cheaply, but validate the outputs and keep latency in check. Provide autocomplete and suggested searches drawn from real popular queries, and always offer helpful "no results" pages with alternatives, not a dead end.
Recommendations: the main approaches
- Rules and popularity. Best sellers, newest items, items in the same category. Simple, transparent and a strong baseline that is surprisingly hard to beat.
- Content-based. Recommend items similar to the one being viewed, using attributes or embeddings of descriptions and images. Works from day one for new items and new users.
- Collaborative filtering. "People who bought this also bought that," learned from behaviour. Needs enough interaction data, and struggles with new items and users (the cold-start problem).
- Hybrid and learned ranking. Combine signals in a model trained on clicks and conversions, and optimise for the outcome you care about rather than clicks alone.
- Language-model assisted. Generate explanations, bundle suggestions or conversational shopping assistants on top of retrieval, with guardrails, as described in our guide to adding generative AI.
Personalisation, carefully
Use context you have legitimately: current session behaviour, past purchases, location or language, and explicit preferences. Start simple, such as recently viewed items and re-order prompts, before building deep profiles. Be transparent about data use, honour consent choices and avoid creepy inferences about sensitive characteristics. Provide ways to correct or reset recommendations. Privacy obligations are covered in our privacy law guide; this is general information, not legal advice.

Data and content quality decide the outcome
The most sophisticated engine cannot rescue poor data. Clean product titles, consistent attributes, complete descriptions, good categories and up-to-date stock information matter more than any algorithm. Consider enriching content, generating missing attributes with language models under human review, and deduplicating near-identical items. Keep the index in sync with your database through events or scheduled jobs, with a plan for rebuilding it, using patterns from our background jobs article and our webhooks article.
Measure relevance, not just activity
- Offline evaluation: build a set of representative queries with known good results and compute metrics such as recall and normalised discounted cumulative gain whenever you change the system.
- Online metrics: search click-through rate, zero-result rate, refinement rate, add-to-cart or task completion from search, and revenue per search.
- Experiments: A/B test ranking changes on a slice of traffic, watching for negative side effects; the practices in our feature flags guide help.
- Human review: regularly inspect top queries and failures; metrics alone hide strange results.
Architecture and operations
Keep search as a service behind an API so the rest of the application does not depend on the engine. Index asynchronously, version indexes so you can rebuild and swap without downtime, and secure the engine rather than exposing it directly to browsers. Cache popular queries, and monitor latency, errors and index freshness as in our monitoring guide. Estimate costs of embedding generation and vector storage before choosing an approach, and control them by embedding only what changes. Managed search services reduce operations effort at a price; self-hosted engines give control. See our cloud cost guide.
Common mistakes
- Jumping to vectors when a tuned keyword engine would solve the problem.
- No analytics, so no one knows whether search is improving.
- Ignoring permissions: results must respect what each user may see.
- Recommendations that repeat what the user just bought, or show out-of-stock items.
- Over-personalising with too little data.
- Slow search: relevance does not matter if the results arrive late.
A practical path
- Instrument search and study the queries.
- Move to a proper full-text engine with synonyms, facets and typo tolerance.
- Add popularity and simple content-based recommendations.
- Introduce embeddings for the query types that need them, and merge with keyword results.
- Add re-ranking, personalisation and experiments as the data supports them.
Our software team designs and builds search and recommendation features for custom applications and stores, from a quick relevance overhaul to a full hybrid engine, and our maintenance plans keep indexes, models and metrics healthy over time.
Put this into practice with CodeLuma
CodeLuma builds search and recommendation features that understand intent, rank by what your users actually value and prove their worth with measurement, from a quick upgrade to a full hybrid engine.
- Custom software development - tailored systems, integrations and internal tools.
- Website and web application development - fast, accessible, search-friendly builds.
- Maintenance and support plans - updates, monitoring and ongoing improvement.
Start a conversation. Tell us about your project and we will reply with practical next steps, or browse all CodeLuma services. CodeLuma Development Inc. is a Canadian company that works with teams in Windsor, Essex, London, Toronto, Mississauga and across Ontario, throughout Canada and remotely.


