The Architecture Behind Closot's Universal Search

Craft
Tarun Dubey·

Universal search is Closot's most-used feature. Users hit Cmd+K an average of 47 times per day. That means search needs to be fast, accurate, and aware of permissions — every single time.

Hybrid search: keywords + semantics

We run two search engines in parallel for every query. A traditional inverted index handles exact keyword matches, acronyms, and IDs. A vector index handles semantic similarity — so "how do we handle refunds" finds the "Return Policy" page even though neither word appears in the query.

Results from both engines are merged using a learned ranking model that considers: text relevance, semantic similarity, recency, the searcher's access patterns, and page popularity within their team.

Search architectureUser queryInverted index (BM25)Vector index (HNSW)Ranked results (<80ms)

Permission-aware results

The trickiest part of universal search isn't relevance — it's permissions. Every result must respect workspace, teamspace, and page-level access controls. We pre-compute permission sets per user and filter results at the index level, so restricted pages never appear even briefly.

Tarun Dubey·
Copy link