@angularforge/command-palette
Fuzzy Search
How the built-in search engine ranks results.
FuzzySearchEngine matches commands against their label , description , category , and keywords . Results are ranked highest-first:
"users" matches "users" | |
"use" matches "users" | |
"use" matches "Create Users" | |
"ser" matches "Users" | |
"usr" matches "Users" |
provideCommandPalette({ fuzzySearch: false });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