Global Search & Typesense Integration

Search in BiiTrust is not just a secondary lookup tool—it is the primary fast-action console across the entire platform. Designed around a sub-second search engine, it helps you locate any borrower, loan, receipt, or screen in fewer than three keystrokes.


You can summon the search console instantly from anywhere in the platform:

  • Desktop Shortcut: Press / or Ctrl + K (or Cmd + K on macOS) on any page (when not typing inside a form field).
  • Mobile Floating Dock: Tap the prominent Search stadium pill situated directly in the center of the mobile dock.
  • Top Bar: Click the search lens icon in the main navigation.

2. Typesense Search Engine & Architecture

Under the hood, search queries are executed directly against Typesense, a high-performance in-memory search cluster:

  • Instant Latency: Typical search query latency is under 15 milliseconds.
  • Phonetic & Typo Tolerance: Searches forgive up to 2 character typos or transposed letters (e.g., typing “Mwanyiki” still matches “Mwangi”, typing “Peter Oteno” matches “Peter Otieno”).
  • Prefix Matching: Matches as you type; typing “wan” instantly returns “Wanjiku”, “Wanjiru”, and “Wanyama”.

Scoped Search Keys & Security

To prevent unauthorized data access across branches while maintaining blazing search speeds:

  1. HMAC-SHA256 Scoped Key: When a user logs in, the backend issues an ephemeral Typesense Scoped Search Key tied to their session.
  2. Branch Isolation:
    • For Loan Officers and Tellers, the key embeds an immutable search filter: filter_by: branch_id:BRX-001.
    • The user’s browser connects directly to Typesense, but the search engine physically restricts results to their assigned branch.
    • Branch Managers are scoped to their branch network; Directors and Compliance Officers receive institution-wide search keys.
  3. Zero Token Leakage: The master Typesense search API key never leaves the secure backend server.

3. Search Query Syntax & Entity Prefixes

While natural language typing works out of the box, power users can use explicit query prefixes to jump directly to specific records:

Query PrefixTarget EntityExample QueryWhat Happens
client: or c:Borrower Profilesclient: 28910482Directly searches borrower national IDs and client numbers.
loan: or l:Active Loansloan: 004821Searches specific loan account numbers (LOX-004821).
app: or a:Loan Applicationsapp: 001284Directly locates credit committee dossiers in /applications.
pay: or p:Payment Receiptspay: SJL89X2KLMMatches M-Pesa 10-character transaction codes or cashier receipt numbers.
@staffStaff Directory@kevinFinds loan officer profiles, branch assignments, and contact details.

The search console dynamically adapts as you interact with it:

1. The Empty State (Zero-State)

Before you type a single character, the search screen presents:

  • Recent Searches: Your last 8 searches stored privately on your device. Click any item to repeat the query instantly.
  • Role Shortcuts (“Go To”): Direct links to the screens and reports your specific role reaches for most frequently.

2. The Typing State (Instant Autocomplete)

As you begin typing, the engine triggers an instant 150ms lookup:

  • Screens First: Matches application screens, settings, and reports locally on your device with zero network lag.
  • Record Suggestions: Shows borrower names, phone numbers, and loan IDs that match your characters.

3. The Searched State (Multi-Collection Overview)

After pressing Enter (or pausing for 450ms), the system organizes results into clear collection cards:

  • Clients: Top 5 matching borrower profiles.
  • Loans: Top 5 matching credit facilities.
  • Payments: Top 5 matching transaction receipts.
  • Applications: Top 5 matching loan dossiers.
  • Each group includes a Show all N in [Collection] link to expand that specific category.

4. The Single Collection State (Deep Drilldown)

Clicking any category chip narrows the screen to that collection alone:

  • Displays 20 records per page.
  • Provides deep filtering attributes (e.g., filtering loans by overdue status).
  • Click Load More to paginate through large search lists.

5. The Nothing Found State

If no records match your query:

  • Suggests spelling corrections or alternate identifiers.
  • Keeps any application screens that still match your words.
  • Provides a one-click Search Everything button to clear restrictive category filters.