FacetSort

Version:

Type

Interface

Import path

@sitecore-cloudsdk/search/browser

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

Signature

export interface FacetSort {
  name: FacetSortName;
  order: SortingOptions;
  after?: string;
}

Properties

Name

Type

Description

Value

name

FacetSortName

Required.

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

Must be one of:

  • "text"

  • "count"

order

SortingOptions

Required.

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

Must be one of:

  • "asc"

  • "desc"

after

string

Optional.

The unique identifier of the first facet value to return. Facet values preceding the one you specify will not be returned.

Only applicable when sorting facet values alphabetically ("text").

For example, consider the following individual facets:

  • "Event"

  • "Product"

  • "Partner"

  • "Other"

  • "Legal"

If you set after to the unique identifier of the "Partner" facet, the "Event" and "Partner" facets will be excluded from the response, and the rest will be included.

"facetid_eyJ0eXB"

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