Searchable
@objc
public protocol Searchable : AnyObject
A searchable source of data.
-
Perform a search.
Declaration
Swift
@discardableResult @objc func search(_ query: Query, requestOptions: RequestOptions?, completionHandler: @escaping CompletionHandler) -> OperationParameters
querySearch parameters.
completionHandlerCompletion handler to be notified of the request’s outcome.
Return Value
A cancellable operation.
-
Perform a search with disjunctive facets, generating as many queries as number of disjunctive facets (helper).
Declaration
Swift
@discardableResult @objc func searchDisjunctiveFaceting(_ query: Query, disjunctiveFacets: [String], refinements: [String: [String]], requestOptions: RequestOptions?, completionHandler: @escaping CompletionHandler) -> OperationParameters
queryThe query.
disjunctiveFacetsList of disjunctive facets.
refinementsThe current refinements, mapping facet names to a list of values.
completionHandlerCompletion handler to be notified of the request’s outcome.
Return Value
A cancellable operation.
-
Search for facet values. This searches inside a facet’s values, optionally restricting the returned values to those contained in objects matching other (regular) search criteria.
Declaration
Swift
@discardableResult @objc(searchForFacetValuesOf:matching:query:requestOptions:completionHandler:) func searchForFacetValues(of facetName: String, matching text: String, query: Query?, requestOptions: RequestOptions?, completionHandler: @escaping CompletionHandler) -> OperationParameters
facetNameName of the facet to search. It must have been declared in the index’s
attributesForFacetingsetting with thesearchable()modifier.textText to search for in the facet’s values.
queryAn optional query to take extra search parameters into account. These parameters apply to index objects like in a regular search query. Only facet values contained in the matched objects will be returned.
completionHandlerCompletion handler to be notified of the request’s outcome.
Return Value
A cancellable operation.
Searchable Protocol Reference