fuzzy-ranking
यह क्या करती है
यह स्किल समझाती है कि उन सर्च परिणामों को कैसे स्कोर और फ़िल्टर करें जो लोगों के टाइप किए हुए की सिर्फ़ आंशिक मेल खाते हैं, जैसे छोटा या अधूरा नाम। यह सूची या टेबल में सर्च जोड़ने वाले डेवलपरों के लिए है।
कब इस्तेमाल करें
- ✓जब सर्च बॉक्स को सिर्फ़ आंशिक मेल पर भी आइटम ढूँढने हों।
- ✓जब आप चाहें कि सर्च परिणाम क्वेरी से उनके मेल की नज़दीकी के हिसाब से क्रमबद्ध हों।
- ✓जब आप TanStack Table के किसी कॉलम में fuzzy सर्च फ़िल्टर जोड़ें।
Skill का लिंक
https://github.com/TanStack/table/blob/main/packages/match-sorter-utils/skills/fuzzy-ranking/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे सर्च बॉक्स को ग्राहक का नाम तब भी मिलना चाहिए जब लोग नाम का सिर्फ़ हिस्सा टाइप करें। परिणामों को कैसे रैंक करूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह दिखाती है कि हर आइटम को क्वेरी के मुकाबले कैसे स्कोर करें, सीमा पार करने वाले आइटम रखें, और उन्हें मेल स्कोर से क्रमबद्ध करें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Setup
<!-- skill-snippet:check -->import { compareItems, rankItem, rankings } from '@tanstack/match-sorter-utils'
const query = 'tan'
const values = ['table', 'tanner', 'router']
export const ranked = values
.map((value) => ({
value,
info: rankItem(value, query, { threshold: rankings.MATCHES }),
}))
.filter((entry) => entry.info.passed)
.sort((a, b) => compareItems(a.info, b.info))
Core Patterns
Separate ranking, filtering, and sorting
Call rankItem once, filter on info.passed, retain the RankingInfo, then order matching results with compareItems.
Rank object fields through accessors
type Person = { name: string; email: string }
const person: Person = { name: 'Ada Lovelace', email: 'ada@example.test' }
const info = rankItem(person, 'lov', {
accessors: [(item) => item.name, (item) => item.email],
})
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#table-features and read
its global-filtering reference. 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.
Source: TanStack/table:packages/match-sorter-utils/src/index.ts
HIGH Ranking recomputed during sorting
Wrong: call rankItem for both rows on every comparator invocation.
Correct: retain RankingInfo during filtering and pass the stored values to compareItems.
Sorting is called many times; recomputing also risks using different query/options than the filter decision.
Source: TanStack/table:docs/framework/react/guide/fuzzy-filtering.md
MEDIUM compareItems direction reversed twice
Wrong: negate compareItems(a, b) because a larger rank should appear first.
Correct: use compareItems(a, b) directly for ascending fuzzy relevance.
The function already returns -1 when a.rank is greater than b.rank.
Source: TanStack/table:packages/match-sorter-utils/src/index.ts
API Discovery
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 @tanstack/table-core#table-features and read its global-filtering and sorting references.
अक्सर पूछे जाने वाले सवाल
क्या मैं एक object के कई फ़ील्ड में सर्च कर सकता हूँ?
हाँ। स्किल ऐसे accessors का वर्णन करती है जो रैंकिंग को एक से ज़्यादा फ़ील्ड जांचने देते हैं।
सीमा (threshold) क्या करती है?
यह तय करती है कि कोई आइटम परिणामों में रखे जाने से पहले उसका मेल कितना नज़दीक होना चाहिए।
क्या मैं रैंकिंग को टेबल फ़िल्टर डेटा के रूप में रख सकता हूँ?
हाँ। स्किल बताती है कि रैंकिंग को filter metadata के रूप में कैसे सहेजें और उसके आधार पर क्रमबद्ध करें।
जानकारी
लेखक का मूल विवरण
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.
repo: TanStack/table
लोकप्रियता
- GitHub स्टार
- 29k
- रैंकिंग में स्थान
- #9816
- लाइसेंस
- MIT
- अपडेट की गई
- 21/10/2026
कमेंट
- …
इस repository की और skills
getting-started
29kयह आपके एजेंट को Alpine.js में TanStack Table से डेटा टेबल बनाना और दिखाना सिखाती है, जिसमें सेटअप, रिएक्टिव डेटा और पंक्तियाँ दिखाना शामिल है।
table-state
29kयह आपके एजेंट को Alpine.js में टेबल की स्थिति, जैसे मौजूदा पेज, पढ़ना और नियंत्रित करना सिखाती है, ताकि वह स्थिति बदलने पर स्क्रीन अपडेट हो।
devtools
29kयह आपके एजेंट को Angular टेबल को TanStack Devtools पैनल में रजिस्टर करना सिखाती है, ताकि डेवलपर ऐप बनाते समय हर टेबल की जांच कर सकें।
getting-started
29kयह आपके एजेंट को Angular में TanStack टेबल बनाना और दिखाना सिखाती है, जिसमें injectTable सेटअप, टेम्प्लेट रेंडरिंग और पंक्ति डेटा के अपडेट शामिल हैं।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।