Skip to content
All case studies

Case study 102020

Marketplace Search & Ranking

Product search rebuilt with typo tolerance, facets and learning-to-rank on click data.

Role
Backend engineer
Team
Search team of 3
Timeline
5 months
Focus
Backend, AI

30% → 4%

zero-result searches

+18%

search-to-purchase

90 ms

p95 query latency

Database changes stream into the index through CDC; queries are re-ranked by a model trained on click-through data.PostgreSQL to Debezium CDC; Debezium CDC to Kafka; Kafka to OpenSearch (index); Shopper to Search API (query); Search API to Ranking model; Ranking model to OpenSearch (rerank)PostgreSQLcatalogueDebezium CDCKafkaOpenSearchper-locale analyzersShopperSearch APIRanking modeltrained on clicksindexqueryrerank
Database changes stream into the index through CDC; queries are re-ranked by a model trained on click-through data.

The problem

Shoppers who misspelled a word got zero results, and relevance was alphabetical in practice. Search was the top entry point to the catalogue, and the worst experience in the product.

What I owned

  • The CDC pipeline that keeps the index seconds behind the database.
  • Per-locale analyzers, synonyms and typo tolerance.
  • The learning-to-rank model and the A/B rollout.

Key decisions

  1. 1

    Change data capture, not dual writes

    Debezium streams database changes into the index, so application code never has to remember to update search.

  2. 2

    Ship relevance in steps

    Analyzer and synonym fixes went out first for quick wins. The ranking model came later, measured in an A/B test.

Outcome

Zero-result searches dropped from 30% to 4%, and search went from the weakest entry point to the one that converts best.

  • OpenSearch
  • Python
  • Debezium
  • Kafka
  • PostgreSQL