1. Docs
  2. Developers
  3. Features

Search

The provider model behind global search, scoring, and result navigation.

Global search is a provider aggregation, not an index. When the user types, GlobalSearchService (Mnemo.Infrastructure/Services/Search/) fans the query out to every registered ISearchProvider, each of which scans its own domain in memory and returns scored results. There is no persistent search index to maintain, which is the main design tradeoff: zero index invalidation bugs, at the cost of scan cost growing with workspace size.

Providers

Modules register providers in ConfigureServices; the service collects all of them from DI.

ProviderSearches
NavigationSearchProviderRegistered routes and sidebar labels
NotesSearchProviderNote titles and block content
DecksSearchProviderDeck names, descriptions, tags, with per-deck card match summaries
FlashcardsSearchProviderCard fronts, backs, and tags
MindmapsSearchProviderMap titles and node text
SettingsSearchProviderSettings entries

Adding a feature to global search means implementing ISearchProvider and registering it in the feature’s module.

Matching and scoring

TextSearchMatch tokenizes the query (tokens shorter than 2 characters are dropped) and supports fuzzy matching via Levenshtein distance: one edit allowed for tokens of length 4 to 6, two edits for 7 plus; fuzzy only applies to tokens of length 4 and up. The overlay enables fuzzy by default.

SimpleSearchScorer weighs fields at 50 percent title, 20 percent subtitle, 30 percent body, with boosts for exact matches. Two extra behaviors layer on top for flashcards: topic clusters group two or more cards sharing stem words into a single expandable result, and question-shaped queries pull individual cards out of decks.

Result navigation

Each result carries a SearchNavigationTarget, a route plus a typed parameter, so selecting a result is an ordinary navigation. The flashcard parameter, for example, opens the deck page scrolled to the matching card. The UI is GlobalSearchOverlayViewModel, opened from the top bar or Ctrl+K.

Global search finds content; it is not a command palette. The separate quick-actions overlay (Alt+Shift+Q) covers command-style actions.

Where the code lives

ConcernPath
Service and providersMnemo.Infrastructure/Services/Search/
MatchingTextSearchMatch (same folder), tests in TextSearchMatchTests
Overlay UIMnemo.UI/Components/ global search overlay
Provider contractMnemo.Core/Services/ (ISearchProvider)