<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Search on Sohil Ladhani Blog</title><link>https://sohilladhani.com/blog/tags/search/</link><description>Recent content in Search on Sohil Ladhani Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 12 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://sohilladhani.com/blog/tags/search/index.xml" rel="self" type="application/rss+xml"/><item><title>Faceted Search</title><link>https://sohilladhani.com/blog/post/2026-07-12-faceted-search/</link><pubDate>Sun, 12 Jul 2026 00:00:00 +0000</pubDate><guid>https://sohilladhani.com/blog/post/2026-07-12-faceted-search/</guid><description>Amazon&amp;rsquo;s left sidebar: &amp;ldquo;Brand: Nike, Adidas, New Balance. Price: Under $50, $50-$100. Size: 8, 9, 10, 11.&amp;rdquo; Each filter is a facet. Selecting one narrows results and updates the counts on all other facets. Faceted search is not just filtering — it&amp;rsquo;s computing counts for all possible filter values simultaneously, on the filtered result set.
The Count Problem The hard part is not filtering: &amp;ldquo;show me Nikes under $50&amp;rdquo; is a simple index query.</description></item><item><title>Per-User Search Indexes</title><link>https://sohilladhani.com/blog/post/2026-07-06-per-user-search-indexes/</link><pubDate>Mon, 06 Jul 2026 00:00:00 +0000</pubDate><guid>https://sohilladhani.com/blog/post/2026-07-06-per-user-search-indexes/</guid><description>Web search builds one massive index shared by all users. Email search is different: every query is private to one user, and results depend on that user&amp;rsquo;s labels, read status, and folder structure. Gmail&amp;rsquo;s search index is not one index — it&amp;rsquo;s one index per user. Per-user search indexes are the right architecture when search results are private, personalized, and must reflect user-specific metadata.
Why Not a Shared Index A shared inverted index for email would store every user&amp;rsquo;s email together: word &amp;ldquo;invoice&amp;rdquo; points to all documents across all users containing &amp;ldquo;invoice.</description></item><item><title>Multi-Stage Ranking</title><link>https://sohilladhani.com/blog/post/2026-06-10-multi-stage-ranking/</link><pubDate>Wed, 10 Jun 2026 00:00:00 +0000</pubDate><guid>https://sohilladhani.com/blog/post/2026-06-10-multi-stage-ranking/</guid><description>A search index with a billion documents returns thousands of candidates matching a query. Showing all of them ranked by TF-IDF doesn&amp;rsquo;t produce great results. The ranking signals needed for good results (machine-learned models, user personalization, freshness, domain authority) are expensive to compute. You can&amp;rsquo;t compute them for a thousand candidates in under 100ms.
The solution: a funnel. Use cheap signals to eliminate most candidates fast, then apply expensive signals to the small remainder.</description></item><item><title>Query Expansion</title><link>https://sohilladhani.com/blog/post/2026-06-09-query-expansion/</link><pubDate>Tue, 09 Jun 2026 00:00:00 +0000</pubDate><guid>https://sohilladhani.com/blog/post/2026-06-09-query-expansion/</guid><description>A user searches for &amp;ldquo;couch.&amp;rdquo; The documents say &amp;ldquo;sofa.&amp;rdquo; Without query expansion, no results. With it, the search system understands that &amp;ldquo;couch&amp;rdquo; and &amp;ldquo;sofa&amp;rdquo; are synonyms and expands the query to match either. This seemingly simple addition improves recall dramatically, but introduces its own set of problems.
Synonym Expansion The most basic form: maintain a synonym dictionary. Before executing the query, expand each term with its synonyms.
&amp;#34;couch&amp;#34; → [&amp;#34;couch&amp;#34;, &amp;#34;sofa&amp;#34;, &amp;#34;settee&amp;#34;, &amp;#34;loveseat&amp;#34;] Query: &amp;#34;buy couch&amp;#34; becomes: (buy) AND (couch OR sofa OR settee OR loveseat) Synonym dictionaries are domain-specific.</description></item><item><title>Index Partitioning</title><link>https://sohilladhani.com/blog/post/2026-06-08-index-partitioning/</link><pubDate>Mon, 08 Jun 2026 00:00:00 +0000</pubDate><guid>https://sohilladhani.com/blog/post/2026-06-08-index-partitioning/</guid><description>An inverted index maps terms to the list of documents containing them. A web-scale inverted index has billions of documents and trillions of term-document pairs. It doesn&amp;rsquo;t fit on one machine. You have to partition it.
Two Partitioning Strategies Document partitioning: split documents across machines. Machine 1 has documents 1-1M, machine 2 has documents 1M-2M, and so on. Each machine builds a complete local inverted index over its documents. A query for &amp;ldquo;distributed systems&amp;rdquo; goes to every machine in parallel, each returns its local top-K results, a merger combines and re-ranks.</description></item></channel></rss>