SKSearchResultsCopyMatchingTerms
Obtains the terms in a document that match a query.
Declaration
CFArrayRef SKSearchResultsCopyMatchingTerms(SKSearchResultsRef inSearchResults, CFIndex inItem);Parameters
- inSearchResults:
The search results to examine.
- inItem:
An integer that corresponds to a document URL object (SKDocumentRef) in the search results. A value of ‘1’ identifies the first document URL object in the search results, a value of ‘2’ identifies the second, and so on.
If you’ve created the search results using 1448610 Sksearchresultscreatewithquery, the document URL objects are sorted in ranking order with the top-ranked one first. See 1448618 Sksearchresultsgetinfoinrange for a description of how to get a particular document URL object, or set of them, from a search result.
Return Value
A CFArray object containing term IDs.
Discussion
When using a prefix search, or a search for which the user entered more than one word, there may be multiple terms that match the query. This function returns an array of the term IDs corresponding to these matches.
For example, a user could enter ‘App’ when performing a prefix search. If a document represented in the search group contains the words ‘Apple,’ ‘application,’ and ‘appendectomy,’ the IDs for all of these terms would then appear in the CFArray object that SKSearchResultsCopyMatchingTerms returns.
See SKSearchResultsCreateWithQuery for a description of how to perform a search and get search results. See SKSearchResultsGetInfoInRange for how to extract information, including document URL objects, from a search result. See SKSearchType for a description of the various categories of search.