What problem does it solve?
Fuzzy search implementations often mix ranking, filtering, and sorting into one step, causing incorrect pass decisions, wasted recomputation, and reversed sort order. This Skill shows how to use rankItem, RankingInfo.passed, and compareItems correctly, including wiring fuzzy filters into TanStack Table filter metadata.
Core Features & Use Cases
- Ranked fuzzy matching: Call rankItem once per value, filter on info.passed, and order results with compareItems using thresholds, rankings constants, and min/max bounds.
- Object field ranking: Rank objects through accessor functions with per-accessor thresholds and ranking bounds, plus diacritics handling.
- Table integration: Store RankingInfo as Table filterMeta via addMeta and metaHelper, then sort rows with compareItems in a custom sortFn.
- Use Case: Build a global fuzzy search over a React Table where typing a query filters rows by relevance and keeps the best matches sorted at the top without recomputing ranks on every comparison.
Quick Start
Rank an array of strings against a search query with rankItem, keep only entries whose info.passed is true, and sort them with compareItems.