• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Relevance Ranking for String Comparison
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Relevance Ranking for String Comparison (From: Mijobee Kenobi <email@hidden>)

  • Prev by Date: Re: 1.0 divided by 10 = 0.10000000000000001?
  • Next by Date: Re: CoreData: Accessing specific ManagedObjects
  • Previous by thread: Relevance Ranking for String Comparison
  • Next by thread: NSGraphicsContext size limit?
  • Index(es):
    • Date
    • Thread