1. Interfaces

SearchSuggestionOptions

Version:
TypeInterface
Import path@sitecore-cloudsdk/search/browser

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

Signature

export interface SearchSuggestionOptions {
  exclude?: ArrayOfAtLeastOne<string>;
  keyphraseFallback?: boolean;
  max?: number;
  name: string;
}

Properties

NameTypeDescriptionValue
excludestring[]Optional.

A list of search suggestions to exclude from the response for this suggestion.

Minimum length: 1.
"sneakers"
keyphraseFallbackbooleanOptional.

Whether you want Sitecore Search to use the first suggestion returned by this suggestion block as an alternate search keyphrase if the original keyphrase provided by the site visitor gives zero results.

Useful when a site visitor enters a keyphrase and clicks the search button instead of a suggestion. In this scenario, instead of showing the site visitor an empty search page, you can show search results for the alternate keyphrase.

If you request more than one suggestion object with keyphraseFallback set to true, Sitecore Search uses the first suggestion of the suggestion block.

To see the alternative keyphrase, in SearchOptions, set responseContext to true.
false
maxintegerOptional.

The maximum number of search suggestions to retrieve.

Minimum: 1.

Maximum: 100.

Default: 10.
10
namestringRequired.

The name of the suggestion block. Set to one of the suggestion block names.

To find suggestion block names in Sitecore Search, click Administration > Domain Settings > Feature Configuration > Suggestion Blocks. The name is in Suggestion name.
"context_aware"
If you have suggestions for improving this article, let us know!