Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 12 min read Case study mediumAdept

Building Smarter Search Products: 3 Steps for Evaluating Search Algorithms

Shopify's Help Center search team evaluates new ranking algorithms in three steps: collect ground truth from Kafka interaction events and expert-annotated relevance ratings, score variants offline with MAP and NDCG over thousands of historical queries, then run online A/B tests on metrics like click-through rate, average clicked rank, abandonment and support deflection. Applied to a new Query-specific Pagerank, which boosts results frequently clicked for similar past queries, the framework showed slightly better offline scores. In the A/B test, users clicked more, picked higher-ranked results and ran fewer follow-up searches, so it replaced the view-count-based Vanilla Pagerank. Annotated datasets should be refreshed regularly because document sets go stale.

Related posts

  • Modernizing the Facebook Groups Search to Unlock the Power of Community Knowledge

    Meta Engineering mediumAdept

    Facebook Groups scoped search moved from keyword-only retrieval to a hybrid design that runs lexical and semantic retrieval in parallel. Queries are rewritten, then sent both to the Unicorn inverted index and to a 12-layer, 200M-parameter semantic retriever whose embeddings drive ANN search over a Faiss index. An L2 multi-task multi-label ranker merges the candidates using BM25/TF-IDF and cosine-similarity features and jointly optimizes for clicks, shares and comments. Llama 3 acts as an automated judge in build verification tests, with a graded "somewhat relevant" label. Meta reports higher search engagement with no increase in error rates, and plans to put LLMs directly into ranking and adaptive retrieval.

  • ML based ranking using Nrtsearch

    Yelp Engineering mediumAdept

    Yelp moved ML-based ranking out of a standalone scoring service and into Nrtsearch, its Lucene-based search engine, via an Inference Plugin that extracts features from indexed documents and request parameters and scores them in-process on replica nodes. The change removes the network transfer and feature-payload overhead that became a bottleneck with large candidate sets. MLeap models such as XGBoost and neural networks are stored in MLflow and loaded at replica bootstrap. Teams either implement a Java scorer interface or use a generic scorer that defines features with Lucene expressions. Models are hot-swapped node by node via Jenkins without restarts, scorer changes go through canary and rolling restarts, and Prometheus metrics track model latency and errors.

  • How Etsy Uses LLMs to Improve Search Relevance

    Etsy Code as Craft mediumAdept

    Etsy built an LLM-powered semantic relevance framework that complements engagement signals, which favor popular listings, with judgments of how well listings match query intent across three classes: relevant, partially relevant and irrelevant. Human-labeled golden data validates an o3-based few-shot chain-of-thought annotator with self-consistency sampling. That annotator generates training data for a cascaded distillation stack: a fine-tuned Qwen 3 VL 4B teacher for daily offline evaluation and A/B monitoring via vLLM, and a BERT two-tower student that adds under 10ms in real-time search. The student filters irrelevant results, supplies ranking features and loss weights, and boosts relevant listings, raising fully relevant results from 58% to 62%, though engagement sometimes dips as relevance rises.

  • Search Quality Assurance with AI as a Judge

    Zalando Engineering mediumAdept

    Zalando validated search quality for new markets (Luxembourg, Portugal, Greece) before launch by using a multimodal LLM-as-a-judge instead of manual expert review. Test queries are drawn from existing markets, clustered by NER-tag sets into intent segments, ranked by traffic share and translated with an LLM. An Airflow pipeline then retrieves results from the search service and has GPT-4o score each result 0–4 using product data and images, with ElastiCache deduplicating product lookups and (query, product) judgements to cut cost. Running 1,500 top segments per market surfaced lemmatization gaps, unrecognized terms such as Portuguese "ténis" and "menina", and missing NER tags in Greek, all fixed before go-live.

  • Engineering stories behind the Medium Daily Digest Algorithm: Part 2

    Medium Engineering mediumAdept

    Medium replaced the Bloom filters behind its recommendation filters (muted writers, already-read, presented 3+ times) with per-user DynamoDB queries against the source-of-truth tables, cutting filtering cost roughly 10x and simplifying maintenance. The Bloom filters had grown huge because entries can't be deleted, so unmutes couldn't be reflected, contents couldn't be inspected for debugging, and derived data drifted from the database. Fetching all muted writers per user is cheap because most users mute no one. For the presentation counter, which had been hacked together from three layered Bloom filters, a best-effort query of the most recent 5k presentations (~100ms) is acceptable because the 3-presentation limit is a soft rule.

The quest for software engineering knowledge.

Look:
Layout: