1. @sitecore-cloudsdk/search/server

FacetOptions

Version:

Type

Interface

Import path

@sitecore-cloudsdk/search/server

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.

Signature

export interface FacetOptions {
  all?: boolean;
  max?: number;
  coverage?: boolean;
  sort?: FacetSort;
  types?: ArrayOfAtLeastOne<FacetTypeOptions>;
}

Properties

Name

Type

Description

Value

all

boolean

Optional.

Whether to retrieve all facet types that were configured in Sitecore Search for this widget.

To configure the individual facets, use FacetTypeOptions.

If true, the response will include all facet types defined in Sitecore Search, with their default configuration.

If false, the response will include only the facet types specified in facet.types.

Default: false

true

max

integer

Optional.

The maximum number of facet values to return per facet type.

We recommend that you request fewer than 50 facet values. If you request too many, you will see a lag in response times.

If unset, Sitecore Search returns maximum 10 facet values.

Minimum: 1.

Maximum: 100.

Default: 10.

10

coverage

boolean

Optional.

Whether to include coverage computation for each facet type in the response.

Coverage is a number from 0 to 1, representing the approximate percentage of the total matching index items which fall into at least one facet value.

Use coverage to filter out facets that may not be relevant to the search query. Enabling this setting may negatively affect performance.

Default: false

true

sort

FacetSort

Optional.

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

N/A

types

FacetTypeOptions[]

Optional.

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

Minimum length: 1.

N/A

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