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
proximity
argumentDeclaration
Swift
public let locationProvider: LocationProvider?
-
Manager to provide feedback events
Declaration
Swift
public let feedbackManager: FeedbackManager
-
OfflineManager
withdefault
TileStore.Declaration
Swift
public private(set) var offlineManager: SearchOfflineManager { get }
-
Default options to use when
nil
was passed to thesearch(…: options:)
callFull
SearchOptions
structure would be used when nothing was passed to thesearch
function In other case, each structure field would be tested. Eachnil
field insearch(options:)
parameter would be replaced with the value fromdefaultSearchOptions
Declaration
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
accessToken
Mapbox Access Token to be used. Info.plist value for key
MGLMapboxAccessToken
will be used fornil
argumentlocationProvider
Provider configuration of LocationProvider that would grant location data by default
defaultSearchOptions
Default options to use when
nil
was passed to thesearch(…: options:)
callapiType
choose which API provider to use through this search engine. Currently defaults to SBS.
-
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 -> RecordsProviderInteractor
Parameters
dataProvider
IndexableDataProvider to register
priority
data layer priority compared with other layers. Bigger is higher in result’s list.
Return Value
interactor for data operations (add, update, delete)