Score and rank search results by relevance to query. Part of the DevTools Surf developer suite. Browse more tools in the Database Tools collection.
Use Cases
Rank internal search results by relevance to a user query across product names and descriptions.
Score document retrieval quality in a knowledge base or documentation search.
Compare relevance scoring algorithms (TF-IDF vs. BM25) on the same dataset.
Debug why a specific document ranks lower than expected for a query.
Tips
Weight title matches more heavily than body text — titles have higher precision for relevance signaling in most search contexts.
Implement BM25 instead of TF-IDF for modern relevance scoring — BM25's term saturation prevents long documents from unfairly dominating results.
Test relevance with real user queries from search logs, not synthetic test queries — user intent often differs from what engineers expect.
Fun Facts
TF-IDF (Term Frequency-Inverse Document Frequency) was developed by Karen Sparck Jones in 1972 and remained the dominant search relevance model until the 2010s.
Google's original PageRank algorithm, described in Sergey Brin and Larry Page's 1998 paper, combined link-based authority with text relevance scoring — the combination was revolutionary at the time.
BM25 (Best Match 25), the current industry-standard relevance model, was developed by Stephen Robertson and Karen Sparck Jones at City University London in the early 1990s.
FAQ
What is BM25 and why is it better than TF-IDF?
BM25 adds term frequency saturation (diminishing returns from repeated terms) and document length normalization. This prevents long documents from dominating just because they contain a query term more times.
When should I use a vector search instead of BM25?
Vector (semantic) search is better for intent matching and synonyms. BM25 is better for exact keyword recall. Production systems often combine both — BM25 for recall and vector similarity for re-ranking.