From Text to Context: How We Introduced a Modern Hybrid Search at GetYourGuide

Alexander Butenko, Ansgar Gruene, Dharin Shah, Ryan Sequeira20 Nov 2024

Problem

GetYourGuide is a travel marketplace with over 150,000 activities in 35+ languages. Its full-text search used pure lexical matching, which handled simple queries but failed on descriptive ones. A query like "family-friendly Paris activities" did not reach Harry Potter tours or nightlife. The index depended on language, so a query in a language other than the platform setting often returned nothing. The team expected hybrid search to give more results and fewer empty result pages.

Example from the article: for "barcelona night life" the lexical search returned 4 activities, and the hybrid search returned 69.

Solution in brief

Run BM25 and vector search together in one OpenSearch query and rank by a weighted sum of the BM25 score, cosine similarity and a product popularity score. Use a fine-tuned multilingual-e5-small model for query and product vectors, served on CPU. Skip hybrid search for pure location queries, and retry with looser thresholds when the first pass returns nothing.

Questions this case answers
  • How to add semantic retrieval to a keyword search over a catalog when no human-labelled relevance data exists and query embeddings must be computed live on CPU
  • How to combine lexical and embedding scores into one ranked list when their score distributions differ and a popularity signal also matters
  • How to add semantic retrieval to a keyword search engine without replacing it?
  • How to combine BM25 and embedding scores into one ranking?

Tools and methods

  • BM25 (OpenSearch) — lexical score, kept as one part of the final ranking
  • multilingual-e5-small, fine-tuned with Sentence Transformers — query and product embeddings
  • Linear combination of scores — final ranking; constants fitted by a small linear regression
  • FastAPI inference service with ONNX — real-time query vectors on CPU
  • Kafka — event-driven product embedding updates
  • NDCG offline, then A/B tests — model selection and rollout
Continue reading — it's free

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