Relevance Ranking for String Comparison
Relevance Ranking for String Comparison
- Subject: Relevance Ranking for String Comparison
- From: Mijobee Kenobi <email@hidden>
- Date: Tue, 28 Mar 2006 13:18:48 -0500
I'm looking for a method of comparing a search string with another
arbitrary string and calculating some sort of valid relevance ranking
for it. I tried using the Spotlight API but I haven't gotten any value
other than zero and it looks like that's because Spotlight doesn't
provide relevance rankings when only searching the display name. Are
there any provided methods for calculating relevance? I've included the
relevant lines of code in case I'm just doing something wrong, I can
post more if necessary. Thanks in advance.
Query:
(kMDItemDisplayName == \"*saf*\"cd) && (kMDItemContentTypeTree ==
'com.apple.application') && (kMDItemContentType != com.apple.mail.emlx)
&& (kMDItemContentType != public.vcard)
Code Snippet:
...
itemRef = (MDItemRef)MDQueryGetResultAtIndex(queryRef, 0);
relevance = MDItemCopyAttribute(itemRef, kMDQueryResultContentRelevance);
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden