A function identified as deprecated has been superseded and may become unsupported in the future.
Obtains the indexes for a search group. (Deprecated in Mac OS X v10.4. Use asynchronous searching with SKSearchCreate instead, which does not employ search groups.)
CFArrayRef SKSearchGroupCopyIndexes ( SKSearchGroupRef inSearchGroup );
The search group whose indexes you want to copy.
A CFArray object containing the indexes in the search group.
Although the search functions SKSearchResultsCreateWithQuery
and SKSearchResultsCreateWithDocuments
operate directly on search groups, many Search Kit functions, such as SKIndexCompact
, operate on one index at a time. When you want to examine or manage all the indexes in a search group, use SKSearchGroupCopyIndexes
to get the search group’s list of indexes.
SKSearch.h
Creates a search group as an array of references to indexes. (Deprecated in Mac OS X v10.4. Use asynchronous searching with SKSearchCreate instead, which does not employ search groups.)
SKSearchGroupRef SKSearchGroupCreate ( CFArrayRef inArrayOfInIndexes );
A CFArray object containing the indexes to put into the search group.
An SKSearchGroup opaque type.
Creates a search group as an array of references to indexes.
You create a search group to search one or more indexes, and then typically use the resulting SKSearchGroupRef
opaque type with SKSearchResultsCreateWithQuery
or SKSearchResultsCreateWithDocuments
.
When your application no longer needs the search group, dispose of it by calling CFRelease
.
SKSearch.h
Obtains the terms in a document that match a query. (Deprecated in Mac OS X v10.4. Use SKSearchCreate
instead.)
CFArrayRef SKSearchResultsCopyMatchingTerms ( SKSearchResultsRef inSearchResults, CFIndex inItem );
The search results to examine.
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 SKSearchResultsCreateWithQuery
, the document URL objects are sorted in ranking order with the top-ranked one first. See SKSearchResultsGetInfoInRange
for a description of how to get a particular document URL object, or set of them, from a search result.
A CFArray object containing term IDs.
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 “Deprecated Search Keys”
for a description of the various categories of search.
SKSearch.h
Finds documents similar to given example documents. (Deprecated in Mac OS X v10.4. Use SKSearchCreate
instead.)
SKSearchResultsRef SKSearchResultsCreateWithDocuments ( SKSearchGroupRef inSearchGroup, CFArrayRef inExampleDocuments, CFIndex inMaxFoundDocuments, void *inContext, SKSearchResultsFilterCallBack inFilterCallBack );
A search group containing the indexes which, in turn, contain the document URL objects (SKDocumentRefs) representing the documents you want to search by similarity. The search group must also contains the indexes that contain the textual content of the example documents.
An array of document URL objects (SKDocumentRefs), each representing an example document.
The maximum number of found items to return. Your application must pass in a positive value.
An application-specified context for use by the SKSearchResultsFilterCallBack
callback function. Can be NULL
.
A callback function for hit testing during searching—see SKSearchResultsFilterCallBack
. In a similarity search, your application would typically use this function to exclude the example documents from the search results. This parameter can be NULL
, in which case your application receives the returned results directly and without any custom postprocessing.
A search results object containing a list of document URL objects (SKDocumentRefs) representing documents similar to the example documents.
This function searches the on-disk indexes in a search group for document URL objects (SKDocumentRefs) representing documents similar to those provided as examples. Build the search group in three steps:
Collect the index IDs from the search groups you want to search: for each search group, call the SKSearchGroupCopyIndexes
function.
Add the document URL objects representing the example documents to a memory-based index (if they’re not already in an index) by calling SKIndexCreateWithMutableData
, and get that index’s ID.
Create a new search group that contains the indexes to search, and also containing the example-documents index, using SKSearchGroupCreate
.
Before invoking a search, call SKIndexFlush
on all indexes in the search group to ensure that changes to the indexes have been written to disk.
Once you’ve obtained the results of a search, get the specifics—including which documents match the user’s similarity query, and the ranking scores for each document—by calling SKSearchResultsGetInfoInRange
.
When your application no longer needs the search result, dispose of it by calling CFRelease
.
SKSearch.h
Queries the indexes in a search group. (Deprecated in Mac OS X v10.4. Use SKSearchCreate
instead.)
SKSearchResultsRef SKSearchResultsCreateWithQuery ( SKSearchGroupRef inSearchGroup, CFStringRef inQuery, SKSearchType inSearchType, CFIndex inMaxFoundDocuments, void *inContext, SKSearchResultsFilterCallBackinFilterCallBack );
The search group to query.
The query string to search for.
The category of search to perform. See the “Deprecated Search Keys”
enumeration for options.
The maximum number of found items to return. Your application must pass in a positive integer value.
An application-specified context for use by the SKSearchResultsFilterCallBack
. Can be NULL
, but if you want to use the callback you must supply a context.
A callback function for hit testing during searching. Can be NULL
, in which case your application receives the returned results directly and without any custom postprocessing. If non-NULL
, you must supply a context. See SKSearchResultsFilterCallBack
.
A search results object.
This function searches the on-disk indexes in a search group. Before invoking a search, call SKIndexFlush
on all indexes in the search group to ensure that changes to the indexes have been flushed to disk.
Once you’ve obtained the results of a search, get the specifics—including which documents match the user’s query, and the ranking scores for each document—by calling SKSearchResultsGetInfoInRange
. You can extract other information by calling SKSearchResultsCopyMatchingTerms
and SKSearchResultsGetCount
.
When your application no longer needs the search result, dispose of it by calling CFRelease
.
This deprecated function performs searches synchronously. Apple recommends using the asynchronous SKSearchCreate
function instead.
In the current implementation of Search Kit, unary Boolean operators are not implemented. A search, for example, for ‘not blue’, returns zero documents no matter what their content.
SKSearch.h
Gets the total number of found items in a search. (Deprecated in Mac OS X v10.4. Use SKSearchCreate
instead.)
CFIndex SKSearchResultsGetCount ( SKSearchResultsRef inSearchResults );
A search results object containing the results of a query.
A CFIndex object containing the total number of found items in a search.
SKSearch.h
Extracts information from a Search Kit query result. (Deprecated in Mac OS X v10.4. Use SKSearchCreate
instead.)
CFIndex SKSearchResultsGetInfoInRange ( SKSearchResultsRef inSearchResults, CFRange inRange, SKDocumentRef *outDocumentsArray, SKIndexRef *outIndexesArray, float *outScoresArray );
The search results whose information you want to extract.
The starting ranking and total number of found items to obtain, specified as (Location, Length)
. ‘Location’ specifies the starting item by ranking, with the top-ranked item having a location of 0. ‘Length’ specifies the total number of items to include in the results. For example, (0,1) indicates the first item, which is also the highest-ranking item. (1,1) indicates the second item, which is also the second-highest-ranking item. (0,5) means to get the first 5 items.
On output, points to an array of found document URL objects (SKDocumentRefs).
On output, points to an array of indexes in which the found document URL objects reside. Can be NULL
on input, provided that your application doesn’t need this information.
On output, points to an array of correspondence scores for found items. Can be NULL
on input, provided that your application doesn’t need this information.
The number of items returned—usually the same number as specified by the length item in the inRange
parameter.
This function provides results to its output parameters in the order in which they are found, to reduce latency and to support search-as-you-type functionality.
SKSearch.h
© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-06)