1. @sitecore-cloudsdk/search/browser

SearchRuleOptions

Version:

Type

Interface

Import path

@sitecore-cloudsdk/search/browser

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.

Signature

export interface SearchRuleOptions {
  behaviors?: boolean;
  blacklist?: { filter: Filter };
  boost?: ArrayOfAtLeastOne<Boost>;
  bury?: { filter: Filter };
  include?: ArrayOfAtLeastOne<Include>;
  pin?: ArrayOfAtLeastOne<PinItem>;
}

Properties

Name

Type

Description

Value

behaviors

boolean

Optional.

If set to true, the response will contain a list of behaviors that apply to this request.

Typically, behaviors are rules defined in Sitecore Search.

Find a list of rules in Sitecore Search in one of two places:

  • Click Widgets > the widget of your choice > Widget Variations > the variation of your choice > Rules.

  • Click Global Resources > Global Widget > Global Widget Variations > the variation of your choice > Rules.

true

blacklist

{ filter: Filter }

Optional.

Blacklist rule for this request. Use a blacklist rule to exclude an item or a group of items from the search results. Useful when you do not want to show certain items on a certain website or for specific site visitors.

N/A

boost

Boost[]

Optional.

Boost rules for this request. Use a boost rule to increase the relevance of an item or group of items by making them appear higher in the search results. Used to improve the visibility of certain content.

Minimum length: 1.

N/A

bury

{ filter: Filter }

Optional.

Bury rules for this request. Use a bury rule to decrease the relevance of an item or group of items by making them appear lower in the search results. Used to reduce the visibility of certain content.

N/A

include

Include[]

Optional.

Include rules for this request. Use an include rule to force a list of items or categories to appear in specific slots, even if they are not in the natural results set for this request.

To force a single item or category to appear in a fixed slot, use a pin rule.

Minimum length: 1.

N/A

pin

PinItem[]

Optional.

Pin rules for this request. Use a pin rule to force an item to appear in a specific slot even if it is not in the natural results set for this request.

To force a list of items or categories to appear in fixed slots, use an include rule.

Minimum length: 1.

N/A

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