Rank fuzzy matches with rankItem, filter with RankingInfo.passed, compare saved ranking metadata with compareItems, and configure rankings, thresholds, accessors, min/max bounds, or diacritics. Load for @tanstack/match-sorter-utils itself or fuzzy Table filterMeta wiring.
Rank fuzzy matches with rankItem, filter with RankingInfo.passed, compare saved ranking metadata with compareItems, and configure rankings, thresholds, accessors, min/max bounds, or diacritics. Load for @tanstack/match-sorter-utils itself or fuzzy Table filterMeta wiring.
Accessor options can set a per-accessor threshold plus minRanking/maxRanking bounds.
Store ranking as Table filter metadata
In a Table filterFn, call addMeta?.({ itemRank }). Register the corresponding
meta shape with filterMeta: metaHelper<{ itemRank: RankingInfo }>(). A related
sortFn reads row.columnFiltersMeta[columnId]?.itemRank and uses compareItems,
falling back to an ordinary comparator for ties or absent metadata. For the
primary Table composition, load @tanstack/table-core#global-filtering and
register the fuzzy filter under filterFns for globalFilterFn: 'fuzzy'.
Common Mistakes
HIGH Numeric rank used as pass flag
Wrong: if (rankItem(value, query).rank) include(value).
Correct: test rankItem(value, query).passed.
Ranks below the configured threshold can still be nonzero; passed records the threshold decision.
Inspect node_modules/@tanstack/match-sorter-utils/dist/index.d.ts for the installed RankItemOptions, accessor attributes, ranking constants, and comparator behavior. For TanStack Table metadata integration, load the global-filtering and sorting skills.