Fuzzy Search Filter
Use the Fuzzy Search filter for names, titles, and other text where misspellings or transposed characters should still find a result. It applies deterministic Damerau-Levenshtein similarity and previews the best matching unique values.
Source code
grid.plugins = [AdvanceFilterPlugin];
grid.columns = [
{ prop: 'customer', name: 'Customer', filter: ['string', FILTER_FUZZY] },
];
grid.filter = true;
return [
{ customer: 'Jon Smith' },
{ customer: 'John Smith' },
{ customer: 'Jon Smythe' },
{ customer: 'Jane Stone' },
];Quick start
Section titled “Quick start”import { AdvanceFilterPlugin, FILTER_FUZZY } from '@revolist/revogrid-pro';import '@revolist/revogrid-pro/dist/revogrid-pro.css';
grid.plugins = [AdvanceFilterPlugin];grid.columns = [ { prop: 'customer', name: 'Customer', filter: ['string', FILTER_FUZZY] },];grid.filter = true;The popup lets users enter a term and adjust its similarity threshold. Keeping 'string' also exposes exact text operators.
Operator and state
Section titled “Operator and state”| Body ID | Saved operator | Value shape |
|---|---|---|
fuzzy | fuzzy | { term: string, threshold: number } |
The term is trimmed. The threshold is clamped to 0..1 and defaults to 0.55 when the saved value is missing or invalid. Matching is case-insensitive; exact and contained text score highly, while word-level similarity also contributes.
Restore a fuzzy filter
Section titled “Restore a fuzzy filter”grid.filter = { multiFilterItems: { customer: [ { id: 1, type: 'fuzzy', value: { term: 'Jon Smth', threshold: 0.7 }, relation: 'and', }, ], },};An empty or whitespace-only term removes the condition.
Key behavior
Section titled “Key behavior”- The preview ranks at most five matches by default and considers at most 2,000 unique candidates.
- The predicate and preview use the same deterministic score.
null,undefined, objects, and functions do not match; other scalar values are converted to text.- The preview reads parsed unique column values. With remote or partially loaded rows, provide complete structured-filter aggregates when the preview must represent the full dataset.
The built-in has no per-column option object. Store the desired threshold in the condition value; create or replace a structured registration only when you need a different editor experience.
Common mistakes
Section titled “Common mistakes”- Do not use a percentage such as
70; thresholds use the0..1range, so use0.7. - Do not expect the preview to scan an unlimited high-cardinality column; its candidate work is deliberately bounded.
- Do not use fuzzy search for exact identifiers. Use the Token List filter instead.