Definition of a Facet shown in the Gallery UI.

If a field is specified, the Facet will be "dynamic" in that it will request aggregations for the field and use the returned values to create the FacetOptions.

Facet contains and array if FacetOptions. When selected in the UI, a FilterGroup is constructed from the Facet.operation and the Filters are from the selected FacetOptions.


Property Type Notes
accordionClosed Optional boolean
aggField Optional string
aggLimit Optional number

limit of aggregates returned. Max 200

display Optional "map" | "single-select" | "multi-select" | "date-range" | "histogram"

Display for this facet. Not all facets will be compatible with all displays

field Optional string

field to generate the facet from

key Optional string

Unique key, used for query params and telemetry

label Optional string

Translated label for the facet

operation Optional "OR" | "AND"

Operation is passed into the FilterGroup that is constructed when the Facet is serialized. Implemetations should default to "OR" if not specified

optionLimit Optional number

Number of facet options to show by default. Only applies to multi-select, and defaults to all.

options Optional IFacetOption[]

Individual options for this Facet

orderBy Optional "count" | "label"

Specifies how to order the facet options. Only applies to multi-select, and defaults to count.

  • count: orders by option.count in descending order of frequency
  • label: orders by option.label in ascending alphabetical order
pageSize Optional number
state Optional "open" | "closed"

State of the Facet

type Optional "single-select" | "multi-select" | "date-range" | "histogram"

Interface defined in common/src/search/types/IFacet.ts:14