Fuzzy Search

How the built-in search engine ranks results.

The built-in FuzzySearchEngine matches commands against their label , description , category , and keywords . Results are ranked highest-first:

Score Match type
1000 Exact match — "users" matches "users"
800 Prefix match — "use" matches "users"
600 Word-prefix match — "use" matches "Create Users"
400 Substring match — "ser" matches "Users"
1–199 Fuzzy character match — "usr" matches "Users"

Disable fuzzy matching to use substring-only search:

provideCommandPalette({ fuzzySearch: false });

The FuzzySearchEngine is exported for standalone use:

import { FuzzySearchEngine } from '@angularforge/command-palette';

const engine = new FuzzySearchEngine();
const results = engine.search(commands, 'usr');        // fuzzy on
const strict  = engine.search(commands, 'usr', false); // substring only