Rethinking Zomato Search (Part One)

Himanshu Shukla, Saurav Singh2022

Problem

Zomato serves millions of search queries a day, and search is the core of its platform. The old ranking worked well for a given region, sub-zone or scenario but not everywhere, so rules did not carry over between locations. Misspelled queries were handled only when they returned nothing at all, so a typo that happened to match another dish returned wrong results. Intent matters too: a customer's favourite biryani outlet can differ between delivery and dining.

Example from the article: a query "barger" returned "gargar" before autocorrect and "burger" after it.

Solution in brief

Zomato made three changes: separate auto-suggest tabs for delivery and dining, one learning-to-rank model trained as a pairwise classifier on regional popularity features, and an autocorrect model that combines a phonetic-aware edit distance with a Siamese network. Autocorrect replaces the query only when it is fairly certain the original would fail, and otherwise just suggests a correction.

Questions this case answers
  • How to replace per-region hand-written ranking rules with one learned ranker trained on implicit user feedback
  • How to correct misspelled queries when errors are phonetic or caused by adjacent keys and the catalog vocabulary is short and domain-specific
  • How to choose between silently rewriting a query and only suggesting a correction when the model is unsure
  • How to rank dishes and restaurants in food-delivery search so that one model works in every city and sub-zone?

Tools and methods

  • Pairwise classification (learning to rank) — orders search results using region-level popularity and match features
  • Gradient boosting model — the learner behind the ranker, following a gradient-based optimization guide
  • Custom phonetic edit distance — string distance with special weights for common phonetic confusions
  • Siamese network — scores similarity between any two dish names
Continue reading — it's free

Google or a one-time email code. No password.