RustSearch.sys.mjs

class RustSearch.sys.JsonEngineMethod()

The list of possible submission methods for search engine urls.

class RustSearch.sys.JsonEngineUrl()

Defines an individual search engine URL. This is defined separately to types::SearchEngineUrl as various fields may be optional in the supplied configuration.

RustSearch.sys.JsonEngineUrl.acceptedContentTypes

type: Array.<string>

If this URL performs searches only for certain MIME types, they should be listed here. If this value is None, then it’s assumed the content type is irrelevant. This field is intended to be used for URLs like visual search, which might support certain image types and not others. Consumers can use it to determine whether search UI corresponding to the URL should be shown to the user in a given context.

RustSearch.sys.JsonEngineUrl.base

type: string

The PrePath and FilePath of the URL. May include variables for engines which have a variable FilePath, e.g. {searchTerms} for when a search term is within the path of the url.

RustSearch.sys.JsonEngineUrl.displayNameMap

type: object

A map from locale codes to display names of the URL. This is useful if the URL corresponds to a brand name distinct from the engine’s brand name. Since brand names can be localized, this is a map rather than a URL. The client will fall back to the special locale code “default” when its locale is not present in the map.

RustSearch.sys.JsonEngineUrl.excludePartnerCodeFromTelemetry

type: boolean

Whether the engine’s partner code should be excluded from telemetry when this URL is visited.

RustSearch.sys.JsonEngineUrl.isNewUntil

type: string

Indicates the date until which the URL is considered new (format: YYYY-MM-DD).

RustSearch.sys.JsonEngineUrl.method

The HTTP method to use to send the request (GET or POST). If the engine definition has not specified the method, it defaults to GET.

RustSearch.sys.JsonEngineUrl.params

type: Array.<SearchUrlParam>

The parameters for this URL.

RustSearch.sys.JsonEngineUrl.searchTermParamName

type: string

The name of the query parameter for the search term. Automatically appended to the end of the query. This may be skipped if {searchTerms} is included in the base.

class RustSearch.sys.JsonEngineUrls()

Reflects types::SearchEngineUrls, but using EngineUrl.

RustSearch.sys.JsonEngineUrls.search

type: JsonEngineUrl

The URL to use for searches.

RustSearch.sys.JsonEngineUrls.searchForm

type: JsonEngineUrl

The URL of the search engine homepage.

RustSearch.sys.JsonEngineUrls.suggestions

type: JsonEngineUrl

The URL to use for suggestions.

RustSearch.sys.JsonEngineUrls.trending

type: JsonEngineUrl

The URL to use for trending suggestions.

RustSearch.sys.JsonEngineUrls.visualSearch

type: JsonEngineUrl

The URL to use for visual searches.

class RustSearch.sys.Other()

Other

class RustSearch.sys.RefinedSearchConfig()

Details of the search engines to display to the user, generated as a result of processing the search configuration.

RustSearch.sys.RefinedSearchConfig.appDefaultEngineId

type: string

The identifier of the engine that should be used for the application default engine. If this is undefined, an error has occurred, and the application should either default to the first engine in the engines list or otherwise handle appropriately.

RustSearch.sys.RefinedSearchConfig.appPrivateDefaultEngineId

type: string

If specified, the identifier of the engine that should be used for the application default engine in private browsing mode. Only desktop uses this currently.

RustSearch.sys.RefinedSearchConfig.engines

type: Array.<SearchEngineDefinition>

A sorted list of engines. Clients may use the engine in the order that this list is specified, or they may implement their own order if they have other requirements.

The application default engines should not be assumed from this order in case of future changes.

The sort order is:

  • Application Default Engine

  • Application Default Engine for Private Mode (if specified & different)

  • Engines sorted by descending SearchEngineDefinition.orderHint

  • Any other engines in alphabetical order (locale based comparison)

class RustSearch.sys.SearchApplicationName()

The list of possible application names that are currently supported.

class RustSearch.sys.SearchEngineClassification()

The list of acceptable classifications for a search engine.

class RustSearch.sys.SearchEngineDefinition()

A definition for an individual search engine to be presented to the user.

RustSearch.sys.SearchEngineDefinition.aliases

type: Array.<string>

A list of aliases for this engine.

RustSearch.sys.SearchEngineDefinition.charset

type: string

The character set this engine uses for queries.

RustSearch.sys.SearchEngineDefinition.classification

The classification of search engine according to the main search types (e.g. general, shopping, travel, dictionary). Currently, only marking as a general search engine is supported. On Android, only general search engines may be selected as “default” search engines.

RustSearch.sys.SearchEngineDefinition.clickUrl

type: string

The url used for reporting clicks.

RustSearch.sys.SearchEngineDefinition.identifier

type: string

The identifier of the search engine. This is used as an internal identifier, e.g. for saving the user’s settings for the engine. It is also used to form the base telemetry id and may be extended by telemetrySuffix.

RustSearch.sys.SearchEngineDefinition.isNewUntil

type: string

Indicates the date until which the engine variant or subvariant is considered new (format: YYYY-MM-DD).

RustSearch.sys.SearchEngineDefinition.name

type: string

The user visible name of the search engine.

RustSearch.sys.SearchEngineDefinition.optional

type: boolean

This search engine is presented as an option that the user may enable. The application should not include these in the default list of the user’s engines. If not supported, it should filter them out.

RustSearch.sys.SearchEngineDefinition.orderHint

type: number

A hint to the order that this engine should be in the engine list. This is derived from the engineOrders section of the search configuration. The higher the number, the nearer to the front it should be. If the number is not specified, other methods of sorting may be relied upon (e.g. alphabetical).

RustSearch.sys.SearchEngineDefinition.partnerCode

type: string

The partner code for the engine. This will be inserted into parameters which include {partnerCode}. May be the empty string.

RustSearch.sys.SearchEngineDefinition.telemetrySuffix

type: string

Optional suffix that is appended to the search engine identifier following a dash, i.e. <identifier>-<suffix>. If it is an empty string no dash should be appended.

RustSearch.sys.SearchEngineDefinition.urls

type: SearchEngineUrls

The URLs associated with the search engine.

class RustSearch.sys.SearchEngineSelector()

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

RustSearch.sys.SearchEngineSelector.clearSearchConfig()

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.

RustSearch.sys.SearchEngineSelector.filterEngineConfiguration(userEnvironment)

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.

Arguments:
  • userEnvironment (SearchUserEnvironment)

Returns:

RefinedSearchConfig

RustSearch.sys.SearchEngineSelector.setConfigOverrides(overrides)

setConfigOverrides

Arguments:
  • overrides (string)

RustSearch.sys.SearchEngineSelector.setSearchConfig(configuration)

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.

Arguments:
  • configuration (string)

RustSearch.sys.SearchEngineSelector.useRemoteSettingsServer(service, applyEngineOverrides)

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.

Arguments:
  • service (RemoteSettingsService)

  • applyEngineOverrides (boolean)

static RustSearch.sys.SearchEngineSelector.init()

init

Returns:

SearchEngineSelector

class RustSearch.sys.SearchEngineUrl()

Defines an individual search engine URL.

RustSearch.sys.SearchEngineUrl.acceptedContentTypes

type: Array.<string>

If this URL performs searches only for certain MIME types, they should be listed here. If None, it’s assumed the content type is text or not relevant. This field is intended to be used for URLs like visual search, which might support certain image types and not others. Consumers can use it to determine whether search UI corresponding to the URL should be shown to the user in a given context.

RustSearch.sys.SearchEngineUrl.base

type: string

The PrePath and FilePath of the URL. May include variables for engines which have a variable FilePath, e.g. {searchTerms} for when a search term is within the path of the url.

RustSearch.sys.SearchEngineUrl.displayName

type: string

The display name of the URL, if any. This is useful if the URL corresponds to a brand name distinct from the engine’s brand name.

RustSearch.sys.SearchEngineUrl.excludePartnerCodeFromTelemetry

type: boolean

Whether the engine’s partner code should be excluded from telemetry when this URL is visited.

RustSearch.sys.SearchEngineUrl.isNewUntil

type: string

Indicates the date until which the URL is considered new (format: YYYY-MM-DD).

RustSearch.sys.SearchEngineUrl.method

type: string

The HTTP method to use to send the request (GET or POST). If the engine definition has not specified the method, it defaults to GET.

RustSearch.sys.SearchEngineUrl.params

type: Array.<SearchUrlParam>

The parameters for this URL.

RustSearch.sys.SearchEngineUrl.searchTermParamName

type: string

The name of the query parameter for the search term. Automatically appended to the end of the query. This may be skipped if {searchTerms} is included in the base.

class RustSearch.sys.SearchEngineUrls()

The URLs associated with the search engine.

RustSearch.sys.SearchEngineUrls.search

type: SearchEngineUrl

The URL to use for searches.

RustSearch.sys.SearchEngineUrls.searchForm

type: SearchEngineUrl

The URL of the search engine homepage.

RustSearch.sys.SearchEngineUrls.suggestions

type: SearchEngineUrl

The URL to use for suggestions.

RustSearch.sys.SearchEngineUrls.trending

type: SearchEngineUrl

The URL to use for trending suggestions.

RustSearch.sys.SearchEngineUrls.visualSearch

type: SearchEngineUrl

The URL to use for visual searches.

class RustSearch.sys.SearchUpdateChannel()

The list of possible update channels for a user’s build. Use default for a self-build or an unknown channel.

class RustSearch.sys.SearchUrlParam()

Parameter definitions for search engine URLs. The name property is always specified, along with one of value, experiment_config or search_access_point.

RustSearch.sys.SearchUrlParam.enterpriseValue

type: string

Same as value but only used if Services.polices.isEnterprise is true. Overrides other parameters of the same name.

RustSearch.sys.SearchUrlParam.experimentConfig

type: string

The value for the parameter will be derived from the equivalent experiment configuration value. Only desktop uses this currently.

RustSearch.sys.SearchUrlParam.name

type: string

The name of the parameter in the url.

RustSearch.sys.SearchUrlParam.value

type: string

The parameter value, this may be a static value, or additionally contain a parameter replacement, e.g. {inputEncoding}. For the partner code parameter, this field should be {partnerCode}.

class RustSearch.sys.SearchUserEnvironment()

The user’s environment that is used for filtering the search configuration.

RustSearch.sys.SearchUserEnvironment.appName

The application name that the user is using.

RustSearch.sys.SearchUserEnvironment.deviceType

The device type that the user is using.

RustSearch.sys.SearchUserEnvironment.distributionId

type: string

The distribution id for the user’s build.

RustSearch.sys.SearchUserEnvironment.experiment

type: string

The search related experiment id that the user is included within. On desktop this is the searchConfiguration.experiment variable.

RustSearch.sys.SearchUserEnvironment.locale

type: string

The current locale of the application that the user is using.

RustSearch.sys.SearchUserEnvironment.region

type: string

The home region that the user is currently identified as being within. On desktop & android there is a 14 day lag after detecting a region change before the home region changes. TBD: iOS?

RustSearch.sys.SearchUserEnvironment.updateChannel

The update channel of the user’s build.

RustSearch.sys.SearchUserEnvironment.version

type: string

The application version that the user is using.