Nov 2026
9 Mon
10 Tue
11 Wed
12 Thu
13 Fri 09:00 AM – 06:00 PM IST
14 Sat 09:00 AM – 06:00 PM IST
15 Sun
Sneha Bagri
Submitted Oct 9, 2026
Exploring how to make company discovery smarter and faster when user language doesn’t match unstructured business data, balancing search relevance, LLMs, and latency through progressive retrieval.
We built a search over a large universe of companies. The main data for each company is one broad business description. There is no granular taxonomy (sector, sub-sector, product, business model or use case) to filter or group by. This gave us four connected problems.
1. The user’s words and the data’s words do not match: A company can be very relevant to a concept and never use the user’s term.
2. The search string is much shorter than the text it is compared with: Raw query embeddings underperformed because short user queries and long business descriptions are fundamentally different text types, causing vector search to favor surface-level word overlap rather than true business relevance.
3. Company descriptions contain multiple aspects. A single description covers a company’s products, customers, geography, business model and other topics. Its embedding mixes these concepts, making it harder to identify companies relevant to a specific search intent.
4. Making the search smarter made it slower.
We introduced additional query processing such as aliases and LLM-based understanding to improve the interpretation of user input. However, every preprocessing step added latency. The system could become better at understanding a query while simultaneously becoming worse at delivering a responsive search experience. This forced us to rethink the assumption that everything needs to happen before retrieval starts.
The core engineering question was: how do we improve search relevance over unstructured company descriptions without making users wait for every improvement to finish before retrieval begins?
Developers, Platform Engineers, Data/ML Engineers, Engineering Leaders
We will share:
Our users describe the companies they want in their own words. Our only data is free-text business descriptions that use different words, come in five mixed templates, and leave out most of what investors search for. Each step that made the search understand the user better added latency. We dissected the data, compared search approaches in Elasticsearch for quality and latency, and found which steps paid off. We now show a fast first result and improve it in stages.
Today, we would first study the data and build a benchmark to measure search quality. Instead of embedding the user’s raw search, we would use an LLM to rewrite it like a company description, improving search quality. We would show results quickly, without waiting for the LLM, and do most of the LLM work when indexing companies, so search doesn’t have to wait.
Why hybrid search (BM25 + kNN with RRF) over pure vector search? Pure vector search lost the exact terms and acronyms that users depend on. Pure BM25 rewarded keyword repetition over real fit. Hybrid search with Reciprocal Rank Fusion lets aliases drive recall and the embedding drive ranking.
Why rewrite the query with an LLM instead of embedding the raw query? A short query and a long description are different kinds of text. We ask an LLM to write a pseudo company description from the request, so the query and the indexed text have the same shape. The trade-off: one extra LLM call, and a stylistic bias toward the template the rewrite imitates.
What did we optimise for? Time to the first result, then relevance. At first, we showed nothing until the LLM had parsed the user’s input into themes, sub-themes, and a query rewrite. The user waited for every LLM step before seeing a single company. Now we search in two passes. The first pass searches with the query exactly as the user entered it, with no LLM step, so results appear almost at once. While the user looks at them, the LLM parses the input. Then the second pass runs the full hybrid search and replaces the first results with better-ranked ones.
The search still runs on the original descriptions, which come from five different templates and contain boilerplate and some wrong facts. To clean or regenerate all descriptions with an LLM would cost too much time and money, so we improved the queries instead of the data.
Production experience. Hybrid search, LLM query rewrite, aliases, and the two-pass search (raw query first, hybrid second) run in production.
Tags: #search #llm #elasticsearch #rag #latency #casestudy #failurestory #databases
Pankaj Sharma (pankajs@sahaj.ai)
Sneha Bagri (snehab@sahaj.ai)
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}