Problem
Aviasales handles about 200 million searches a month. Sorted by price, a slightly more expensive but convenient ticket sits deep in the list, and users who scroll and filter may leave for a competitor. Heuristics ("cheapest with a convenient layover") fail on routes with many good tickets and on routes where none qualifies. A weighted-penalty formula ranks better but has dozens of hand-tuned weights. After moving to ML, backend and analytics computed features differently, and production results stopped matching training.
Example from the article: on Moscow to Paris, a one-stop daytime ticket via Istanbul costs 24,694 rubles. The cheapest costs 24,181 rubles but has two layovers (some overnight), three low-cost carriers and lands at Beauvais, far from Paris.
Solution in brief
Score every ticket with a CatBoost model and show the top-scored ticket under a "Recommended" badge. Compute features once in the backend, log the feature vectors to Kafka and object storage, and train weekly on those same vectors. Drop features that depend on other results, so scoring fits into the per-partner parallel pipeline for about 70 ms.
Questions this case answers
- How to make the features a model trains on identical to the features its serving code computes when two teams implement them independently
- How to fit per-item model scoring into a read path that merges results from slow external sources, without adding user-visible latency
- How to rank flight search results by convenience instead of price alone when heuristics and hand-tuned penalties stop working
- How to keep training and production features identical when analysts and backend engineers compute them separately
Tools and methods
- Heuristics and penalty weights — the two replaced baselines.
- CatBoost — scores each ticket.
- Apache Kafka and Amazon S3 — transport and storage for logged feature vectors.
- Weekly retraining — last seven days, hot-swapped in memory.
Google or a one-time email code. No password.
