मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)29k · #9816

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/TanStack/table/blob/main/packages/match-sorter-utils/skills/fuzzy-ranking/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

getting-started

29k

यह आपके एजेंट को Alpine.js में TanStack Table से डेटा टेबल बनाना और दिखाना सिखाती है, जिसमें सेटअप, रिएक्टिव डेटा और पंक्तियाँ दिखाना शामिल है।

कोडिंगवेबसाइट और UI (frontend)

table-state

29k

यह आपके एजेंट को Alpine.js में टेबल की स्थिति, जैसे मौजूदा पेज, पढ़ना और नियंत्रित करना सिखाती है, ताकि वह स्थिति बदलने पर स्क्रीन अपडेट हो।

कोडिंगवेबसाइट और UI (frontend)

devtools

29k

यह आपके एजेंट को Angular टेबल को TanStack Devtools पैनल में रजिस्टर करना सिखाती है, ताकि डेवलपर ऐप बनाते समय हर टेबल की जांच कर सकें।

कोडिंगवेबसाइट और UI (frontend)

getting-started

29k

यह आपके एजेंट को Angular में TanStack टेबल बनाना और दिखाना सिखाती है, जिसमें injectTable सेटअप, टेम्प्लेट रेंडरिंग और पंक्ति डेटा के अपडेट शामिल हैं।

कोडिंगवेबसाइट और UI (frontend)

मिलती-जुलती skills