Skip to content

Scopes

A scope in Ecommerce Search defines the type of interaction the client wants with the search engine. The primary function of a scope is to define what data should be contained in a search result. Scopes can be configured with the following:

  • Fields to return is the list of fields to be returned in search results.
  • Default number of results is the default number of results in search responses. This can be overwritten in the search request.
  • Number of SKUs per product is the number of SKUs that are included in a search request for products.
  • Scope domain filters are domain filters that are applied when selecting the scope.

Broadly speaking a scope could be the detail page where all data is needed to present the product or a list overview where only a few core attributes are needed. In general, scopes are expected to be quite stable over the lifetime of a web shop, as changing them often directly affects the layout of the website.

This should be seen in relation to:

  • Segments that define the segment of the selected online store.
  • Context that defines the specifics of the current interaction.

The scope can also specify which Domain filters to use, such as whether or not to show products that are out of stock.

Scope types

Scopes are categorised by type, which makes it possible to track user behaviour and intent. The types are:

  • Full Search: Used for search result pages.
  • Browse: Used for overview pages. (e.g. Category pages, the front page)
  • Details: Used for the content or product page itself.
  • Quick Search: Used for getting suggestions during a quick search.
  • Basket: Used for the basket page.
  • Checkout: Used for the checkout page.
  • Order Confirmation: Used for the order confirmation page.
  • Bands: Used for page widgets. (e.g. recommendations, related products)
  • Machine Search: Used when searching from a system rather than an end user.

Looking at the type, it becomes clear where the search originated from.

Warning

As scope types of search requests are used when analyzing the event history to create dashboard reports, it is important that the use of a scope in search requests corresponds to the type of the scope.

Defaults

Each time a new segment is created, it can be populated with scopes that have meaningful defaults, if specified during segment creation. One scope is generated for each scope type with meaningful defaults for that type.

Search Host

All changes to scopes are made from the Admin part of Ecommerce Search. However, the scope is consumed by the search host. When sending a search request to the search host, the search host will retrieve the scope from the latest cached publication, with the provided scope id. If an incorrect scope id is provided, the search will fail.

Publication flow

Scopes are part of the publication flow for the segment it belongs to. Before any changes made to scopes can be used the publication needs to be published.

Context conditions

Scopes are tightly connected to contexts, since you often want a different context during search, browse, or details. To make sure a context is only used with a specific scope, add a context condition with the scope id. In case a scope id that you added as a context condition is deleted, then you cannot update the context conditions until you remove that scope id from context conditions.

Authenticated scopes

It is possible to limit access to a scope. This can be used to restrict data by having scopes that can only be accessed by certain users. Set AuthenticatedSearchesOnly on the scope to limit access to it.

The authenticated scopes that a user can access are set in the AuthenticatedRequestModel:

1
2
3
4
new AuthenticatedRequestModel
{
  "AllowedScopeIds": new new HashSet<string>{ "mySecretScope" }
};

See Use Authenticated Search for a guide on how to use authenticated search and the AuthenticatedRequestModel.