Re: Relevance Ranking for String Comparison
Re: Relevance Ranking for String Comparison
- Subject: Re: Relevance Ranking for String Comparison
- From: Vince DeMarco <email@hidden>
- Date: Tue, 28 Mar 2006 13:51:54 -0800
On Mar 28, 2006, at 10:18 AM, Mijobee Kenobi wrote:
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);
Relevance only works for textContent queries, and it not filled out
for other query types.
Vince
_______________________________________________
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
_______________________________________________
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