HybridSearch
public final class HybridSearch : Search
Hybrid Search module wraps online and offline search modules that conform to the Search protocol. It orchestrates how the SDK uses the two services to improve the reliability of the Search functionality.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates a hybrid search with geopolitical view set in
store.Throws
An error ifNDSStoreis invalid.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public convenience init( apiKey: String, store: NDSStore, timeout: Measurement<UnitDuration> = .tt.seconds(5), customPOIProviders: [CustomPOIProvider] = [], customAPIURL: URL? = nil ) throwsParameters
apiKeyAPI key for the online search.
storeNDSStore offline map handle. Additionally
NDSStoredefines the overall geopolitical view for both online and offline inHybridSearch. Configure the corresponding geopolitical view inNDSStoreConfigurationand initializeNDSStorewith it.timeoutthe duration after which primary search results are ignored and the alternative search starts handling the query.
customPOIProvidersCustom data providers for injecting external POI data into the search engine.
customAPIURLCustom base URL for online APIs. Defaults to nil and TomTom online API base URL will be used. Can be used to change to another service that implements the same API.
-
This API allows to search places and POIs meeting various criteria.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func search( options: SearchOptions, completion: @escaping (Result<SearchResponse, Error>) -> () ) -> TomTomSDKCommon.CancellableParameters
optionsThe
SearchOptionsstructure to limit the results.completionThe completion closure is called after the response to the request is processed. If no errors occurred,
SearchResponsecontains an array of search results and summary information. If an error occurs,HybridSearchErroris returned in thecompletionclosure.Return Value
a
Cancellableinstance that provides control for request cancellation. -
The Autocomplete API lets you make more meaningful Search API calls by recognizing entities inside an input query and offering them as query terms.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func autocomplete( options: AutocompleteOptions, completion: @escaping (Result<AutocompleteResponse, Error>) -> () ) -> TomTomSDKCommon.CancellableParameters
optionsThe
AutocompleteOptionsstructure to limit the results.completionThe completion closure is called after the response to the request is processed. If no errors occurred,
AutocompleteResponsecontains proposed autocomplete elements, that can be used to implement an input field with the autocomplete feature.Return Value
a
Cancellableinstance that provides control for request cancellation. -
This API provides a list of POI categories.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func requestPOICategories( options: POICategoryOptions, completion: @escaping (Result<POICategoryResponse, Error>) -> () ) -> TomTomSDKCommon.CancellableParameters
optionsThe
POICategoryOptionsstructure to tune the results.completionThe completion closure is called after the response to the request is processed. If no errors occurred,
POICategoryResponsecontains an array of categories and subcategories together with their translations and synonyms.Return Value
a
Cancellableinstance that provides control for request cancellation. -
This API provides detailed information about a POI based on its identifier (entityId).
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func requestPOIDetails( options: POIDetailsOptions, completion: @escaping (Result<POIDetailsResponse, Error>) -> () ) -> TomTomSDKCommon.CancellableParameters
optionsDescribe what POI Details data to request.
completionThe completion closure is called after the response to the request is processed. If no errors occurred,
PoiDetailsResponsecontains the requested search result with POI infoReturn Value
a
Cancellableinstance that provides control for request cancellation. -
The Geometries Data API returns sets of coordinates that represent the outline of a city, country, or land area. The API supports batch requests of up to 20 identifiers.
Note
This API is not supported for onboard search, so the query is handled by online search only. Thetimeoutparameter passed atHybridSearchinitialization has no effect.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func requestGeometryData( options: GeometryDataOptions, completion: @escaping (Result<GeometryDataResponse, Error>) -> () ) -> TomTomSDKCommon.CancellableParameters
optionsDefine geometries to request.
completionParameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred,
GeometryDataResponsecontains an array of geometries data structures.Return Value
a
Cancellableinstance that provides control for request cancellation. -
Asynchronously sends a feedback event for the search.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
@discardableResult public func sendFeedback( feedbackEvent: TomTomSDKSearch.FeedbackEvent, completion: ((Error?) -> ())? = nil ) -> TomTomSDKCommon.CancellableParameters
feedbackEventThe feedback event.
completionIf an error occurred,
completionis called with error.Return Value
a
Cancellableinstance that provides control for request cancellation.
TomTom SDK for iOS (0.53.1)
HybridSearch