SearchEngineSelector

open class SearchEngineSelector:
    SearchEngineSelectorProtocol

SearchEngineSelector parses the JSON configuration for search engines and returns the applicable engines depending on their region + locale.

  • Declaration

    Swift

    required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer)
  • Declaration

    Swift

    public convenience init()
  • Clears the search configuration from memory if it is known that it is not required for a time, e.g. if the configuration will only be re-filtered after an app/environment update.

    Declaration

    Swift

    open func clearSearchConfig()
  • Filters the search configuration with the user’s given environment, and returns the set of engines and parameters that should be presented to the user.

    Declaration

    Swift

    open func filterEngineConfiguration(userEnvironment: SearchUserEnvironment) throws -> RefinedSearchConfig
  • Declaration

    Swift

    open func setConfigOverrides(overrides: String) throws
  • Sets the search configuration from the given string. If the configuration string is unchanged since the last update, the cached configuration is reused to avoid unnecessary reprocessing. This helps optimize performance, particularly during test runs where the same configuration may be used repeatedly.

    Declaration

    Swift

    open func setSearchConfig(configuration: String) throws
  • Sets the RemoteSettingsService to use. The selector will create the relevant remote settings client(s) from the service.

    # Params:

    • service: The remote settings service instance for the application.
    • options: The remote settings options to be passed to the client(s).
    • apply_engine_overrides: Whether or not to apply overrides from search-config-v2-overrides to the selected engines. Should be false unless the application supports the click URL feature.

    Declaration

    Swift

    open func useRemoteSettingsServer(service: RemoteSettingsService, applyEngineOverrides: Bool) throws