1. Display relevant results

Understanding context in Search

In Sitecore Search, context refers to a dynamic set of attributes and conditions that determine how search results are generated and presented. Context enables Search to deliver relevant content by tailoring search results based on user behavior, location, device, and other environmental factors.

You can configure results using context, preview a page in context, or use context to configure widget variation rules, such as boost, bury, and blacklist.

There are two types of context in Search:

  • Visitor context – attributes sent with a search request such as the type of device a visitor uses, the page viewed, and the geographical location. These values are sent in the Context object.
  • Site context – conditions you define in widget rules that determine when and how content is displayed.

The following table lists the contexts available for configuration in Search:

Context nameExpected valuesEnabled by default
Content TypeA system attribute indicating the type of content."Article", "video", "pdf", and so on.Yes
Filter AppliedIndicates whether any filters were applied in the search request payload.True or false.No
IdA system attribute representing the unique identifier of the content item.String or GUID. For example, "12345".Yes
KeywordsThe user's search input, equivalent to widget.items.search.query.keyphrase.Any string. For example, "Sitecore".No
LocaleThe language/region setting based on domain configuration.Locale codes. For example, "en-US", "fr-FR".No
PagesIndicates the specific page(s) in Searchwhere the widget is published.Page names or IDs. For example, "homepage".No
Review RatingA system attribute showing the rating score of a content item.Numeric. For example, 1, 3.5, 5.Yes
Custom AttributesAny additional attributes marked as Available for site context during configuration.Varies. For example, "author", "region".No

(Configurable)
CategoryThe category used to apply rules to products.Category names or paths. For example, "Electronics > Headphones".No
If you have suggestions for improving this article, let us know!