1. @sitecore-cloudsdk/search

@sitecore-cloudsdk/search/browser

Version:

Import path

@sitecore-cloudsdk/search/browser

The browser module of the Cloud SDK search package provides the following functions, classes, interfaces, types, and variables to create search experiences and capture search events from the browser side.

Functions

Work with widgets and events using the following functions:

Name

Description

addSearch

Used as a method by the CloudSDK function to initialize the search package.

Widgets

getWidgetData

Retrieves data for one or more widgets.

Events

widgetView

Sends a widget view event.

widgetItemClick

Sends a widget item click event.

widgetFacetClick

Sends a facet click event.

widgetNavigationClick

Sends a navigation click event.

widgetSuggestionClick

Sends a suggestion click event.

entityView

Sends an entity view event.

Classes

Name

Description

Widgets

WidgetRequestData

Data about the widget or widgets to retrieve.

SearchWidgetItem

A widget item for a search widget.

RecommendationWidgetItem

A widget item for a recommendation widget.

QuestionsAnswersWidgetItem

A widget item for a questions-answers widget.

Context

Context

Details about the site visitor's search request, such as locale, location, device, and web browser information. Sitecore Search uses this data for personalizing search results.

Filters

ComparisonFilter

A filter with relation conditions. Used for filtering search results by comparing the entity's attribute to a certain value.

ListFilter

A filter that returns search results if all or any of a set of values are included in a certain attribute.

LogicalFilter

A filter with logical conditions. Used for returning search results that match a set of filters or that do not match a certain filter.

GeoFilter

A filter that returns search results depending on geographical data, such as the radius of a circular geographical area.

GeoWithinFilter

A filter that returns search results depending on geographical data, such as an area defined by polygon area coordinates.

Filters for facets

ComparisonFacetFilter

A filter with relation conditions. Used for filtering facet values by comparing the facet value to a certain value you provide.

ListFacetFilter

A filter that returns facet values if all or any of a set of values are included in a certain facet value.

LogicalFacetFilter

A filter with logical conditions. Used for returning search results that match a set of filter values or that do not match a certain filter value.

NotFacetFilter

A filter that returns search results that do not match a certain filter value.

Interfaces

Structure objects using the following interfaces:

Name

Description

Events

SearchEventEntity

Data about the index documents the site visitor interacts with in the search results.

SearchEventRequest

Data common to search events.

EntityViewEventParams

Data for entity page view events.

WidgetViewEventParams

Data for widget view events.

WidgetItemClickEventParams

Data for widget item click events.

WidgetFacetClickEventParams

Data for facet click events.

WidgetNavigationClickEventParams

Data for navigation click events.

WidgetSuggestionClickEventParams

Data for suggestion click events.

Widgets

SearchOptions

Options for the search widget item object.

QueryOptions

The query object of the search widget item. Settings related to the site visitor's search query.

SearchSortOptions

Sorting configuration for search results.

SortValue

The sort parameter options of the search widget item. Used to configure the sorting of search results.

SearchRuleOptions

Options for rules. Rules are modifications to widget behavior that can be used to overwrite the natural set of search results, for example, to boost, bury, pin, and blacklist items.

Boost

Boost rules for a search request. Used to improve the visibility of certain content by making an item or group of items appear higher in the search results.

Include

Include rules for a search request. Used to force a list of items or categories to appear in specific slots, even if they are not in the natural results set for a request.

PinItem

Pin rules for a search request. Used to force a single item or category to appear in a specific slot even if it is not in the natural results set for a request.

SearchSuggestionOptions

The suggestion parameter of the search widget item. Used to configure search suggestions.

SearchRankingOptions

The ranking parameter of the search widget item. Used to configure search result ranking.

ResultsOptions

The results object of a widget item.

Recommendation

The recommendation object of a widget item.

Filters

LogicalFilterValues

Logical conditions for filtering search results.

GeoFilterData

Geographical data used for filtering search results.

SuggestionFilterEventParams

Data common to search suggestions and facets. Part of the WidgetSuggestionClickEventParams data used when capturing suggestion click events.

Filters for facets

FacetFilterEventParams

Data for facets. Part of the WidgetFacetClickEventParams data used when capturing facet click events.

RangeFacetFilterEventParams

Data for range facets. Part of the WidgetFacetClickEventParams data used when capturing facet click events.

Facets

FacetOptions

The facet object of the search widget item. Contains facet settings for the search request. For example, how many individual facets to retrieve and in what order.

FacetSort

Sorting configuration for the facet values in the individual facets. For example, the ability to sort in descending alphabetical order.

FacetTypeOptions

The type object of a facet object. Settings for an individual facet.

Context

ContextData

Details about the site visitor's search request, such as locale, location, device, and web browser information. Sitecore Search uses this data for personalizing search results.

LocaleData

The country and language the webpage is being viewed in.

PageData

The URI the site visitor came to the current webpage from.

UserData

Data about the site visitor.

StoreData

Data about the online store where the site visitor made the search request. Typically used in Buy Online Pickup In Store retail strategies.

CampaignData

The UTM parameters in the URL of the webpage.

GeoData

Geographical data about the search request.

LocationData

In context: the geographical coordinates of the location where the site visitor made the search request. In filters: the location that the site visitor wants to see search results for.

BrowserData

Data about the site visitor's web browser.

QuestionsAnswersOptions

Options for retrieving AI-powered questions and answers.

ExactAnswerOptions

Options to retrieve a single answer to the site visitor's query. Used in the questions-answers object of a widget item.

RelatedQuestionsOptions

Options to retrieve AI-generated question-and-answer pairs relevant to the site visitor's query. Used in the questions-answers object of a widget item.

Types

Populate data requests with objects implementing the following types:

Name

Description

Widgets

SearchPersonalizationOptions

Options for personalizing search results.

RecommendationOptions

Options to determine which recommendations are given by a recommendation widget.

QueryType

The type of site visitor query to retrieve an exact answer for.

Pathname

The relative path of the webpage to retrieve widget data for.

ContentOptions

The content options property of the results widget item. Used to select the attributes to request for each item. For example, to request only the title and description attributes.

Recipe

A recipe for recommendations. A recipe is used to determine which recommendations are given by a recommendation widget.

Filters

Filter

Various filter criteria that can be used to filter search results or recommendations.

Operators

One of the available operators. Operators are used for filtering search results.

ComparisonOperators

Comparison operators, such as greater than and less than or equal to. Used for filtering search results and facet values.

ListOperators

Operators that check if all or any of a set of values are included in a certain attribute. Used for filtering search results.

LogicalOperators

The logical operators AND, OR, and NOT. Used for filtering search results.

GeoOperator

An operator for using distance from a specific location to filter search results.

GeoWithinOperator

An operator for using a polygonal area to filter search results.

GeoWithinFilterData

An array of geographical coordinates. Used for filtering search results.

DistanceString

The radius of the circular geographical area where you want Sitecore Search to find suitable search results.

DistanceUnits

The accepted units of distance. Used in DistanceString.

Filters for facets

FacetFilter

One of the available facet filters. Facet filters are the filter settings to apply to a facet type.

FacetTypeFilter

Filter for facet values.

FilteringOptions

Options for filtering. Used for managing how other filtering affects this facet, and how filtering in this facet affects other facets.

Facets

FacetSortName

Whether to sort facet values alphabetically ("text"), or by the number of index items that have this value ("count").

SortingOptions

Whether to sort values in an ascending ("asc") or descending ("desc") order.

Variables

Name

Description

SEARCH_NAMESPACE

The Cloud SDK and package name.

If you have suggestions for improving this article, let us know!