AbstractSearchEngine

public class AbstractSearchEngine : FeedbackManagerDelegate

Common root for SearchEngine and CategorySearchEngine. Should never be instantiated directly

  • SearchEngine supports the latest Single-Box Search APIs

    Declaration

    Swift

    public let supportSBS: Bool
  • Location provider for search results proximity argument

    Declaration

    Swift

    public let locationProvider: LocationProvider?
  • Manager to provide feedback events

    Declaration

    Swift

    public let feedbackManager: FeedbackManager
  • OfflineManager with default TileStore.

    Declaration

    Swift

    public private(set) var offlineManager: SearchOfflineManager { get }
  • Default options to use when nil was passed to the search(…: options:) call

    Full SearchOptions structure would be used when nothing was passed to the search function In other case, each structure field would be tested. Each nil field in search(options:) parameter would be replaced with the value from defaultSearchOptions

    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(),
        supportSBS: Bool = false
    )

    Parameters

    accessToken

    Mapbox Access Token to be used. Info.plist value for key MGLMapboxAccessToken will be used for nil argument

    locationProvider

    Provider configuration of LocationProvider that would grant location data by default

    defaultSearchOptions

    Default options to use when nil was passed to the search(…: options:) call

    supportSBS

    enable support the latest Single-Box Search APIs

  • 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)