YelpMohammad Mohtasham (Software Engineer); Tao Yu (Software Engineer)Explainer
ML based ranking using Nrtsearch
Summary
Nrtsearch’s Inference Plugin embeds machine-learning ranking in the Lucene-based search engine, addressing scalability problems in a two-stage design where a separate inference service scored candidates. Previously, large candidate sets and feature payloads created network-transfer and serialization overhead; the new flow extracts features from index documents or request parameters and scores documents within replica nodes. An ML Scorer selects models, transforms features, runs MLeap-based inference, and aggregates scores, with support for XGBoost, neural networks, multi-model execution, batch inference, and custom Java scorers. Models are loaded from MLflow through cluster configuration, while teams can use Lucene expressions or implement modular interfaces; testing, canary deployment, rolling updates, and Prometheus metrics support operations, and future work includes GPU-based ranking and additional inference engines.
Context
Nrtsearch is a Lucene-based open-source search engine used for business search, reviews search, ad delivery, and photo search. The Inference Plugin supports ML-based ranking in applications including Yelp Search, Ads, and Home Feed.
Approach / What changed
The plugin moves feature extraction and model inference into Nrtsearch’s ranking pipeline. Replica nodes load MLeap-based model bundles from MLflow, extract features from index documents or request parameters, run models through an in-process model server, and optionally combine scores. Teams can use the generic ML scorer with Lucene expressions or provide custom Java scoring modules, then test, canary, deploy, and monitor changes with automated tooling and Prometheus metrics.
Takeaways
Co-locating feature storage and inference in Nrtsearch reduces network transfer, serialization overhead, and latency associated with sending large candidate feature payloads to a standalone inference service.
The ML Scorer orchestrates document-level ranking by selecting models, transforming configured features, running MLeap inference, and aggregating scores for multi-model requests.
Teams can choose a generic scorer using Lucene expressions or implement custom Java modules; model updates can roll through nodes without restarting the cluster, while scorer changes use canary deployment and rolling restarts.
FAQ
How does the plugin reduce the overhead of standalone inference?
Nrtsearch extracts features and runs inference inside the search layer rather than sending candidate features to an external service. This reduces network transfer and serialization overhead, while providing direct access to real-time features in the search and model contexts.
Can teams customize how documents are scored?
Yes. Teams can implement the plugin’s Java interfaces with custom modules to control recall and scoring stages. For simpler requirements, the built-in generic ML scorer lets teams define features with Lucene expressions without writing module code.
How are model and scorer changes deployed differently?
A model-only update uses Jenkins to update one node first and then the remaining replica nodes through an Nrtsearch endpoint, without restarting the cluster. Custom scorers are first deployed to a Canary node, monitored for latency and errors, and then rolled out with a cluster rolling restart.
Source and freshness
- Source
- engineeringblog.yelp.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.