AbstractSearchEngine
public class AbstractSearchEngine : FeedbackManagerDelegate
Common root for SearchEngine and CategorySearchEngine.
Should never be instantiated directly
-
Provide a specific API type
Declaration
Swift
public let apiType: ApiType -
Location provider for search results
proximityargumentDeclaration
Swift
public let locationProvider: LocationProvider? -
Manager to provide feedback events
Declaration
Swift
public let feedbackManager: FeedbackManager -
OfflineManagerwithdefaultTileStore.Declaration
Swift
public private(set) var offlineManager: SearchOfflineManager { get } -
Default options to use when
nilwas passed to thesearch(…: options:)callFull
SearchOptionsstructure would be used when nothing was passed to thesearchfunction In other case, each structure field would be tested. Eachnilfield insearch(options:)parameter would be replaced with the value fromdefaultSearchOptionsDeclaration
Swift
public var defaultSearchOptions: SearchOptions -
Initializer with safe-to-go defaults
Declaration
Swift
public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions(), apiType: ApiType = .defaultType )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MGLMapboxAccessTokenwill be used fornilargumentlocationProviderProvider configuration of LocationProvider that would grant location data by default
defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)callapiTypechoose which API provider to use through this search engine. Currently defaults to SBS.
-
Initializer with safe-to-go defaults
Declaration
Swift
public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions(), apiType: ApiType = .defaultType, baseURL: URL )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MGLMapboxAccessTokenwill be used fornilargumentlocationProviderProvider configuration of LocationProvider that would grant location data by default
defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)callapiTypechoose which API provider to use through this search engine. Currently defaults to SBS.
baseURLA custom Mapbox API endpoint.
-
Register indexable data provider to provide custom data layer for SearchEngine
Throws
SearchError.failedToRegisterDataProvider(error, dataProvider)Declaration
Swift
public func register(dataProvider: IndexableDataProvider, priority: Int) throws -> RecordsProviderInteractorParameters
dataProviderIndexableDataProvider to register
prioritydata layer priority compared with other layers. Bigger is higher in result’s list.
Return Value
interactor for data operations (add, update, delete)
AbstractSearchEngine Class Reference