# Coveo Facet Component (CoveoFacet)

## Index

### Methods

- collapse
- debugInfo
- deselectMultipleValues
- deselectValue
- disable
- enable
- excludeMultipleValues
- excludeValue
- expand
- getBindings
- getCaptionForStringValue
- getDisplayedFacetValues
- getDisplayedValues
- getEndpoint
- getExcludedValues
- getSelectedValues
- getValueCaption
- hasSelectedValue
- hideWaitingAnimation
- reset
- selectMultipleValues
- selectValue
- showLess
- showMore
- showWaitingAnimation
- switchToAnd
- switchToOr
- toggleExcludeValue
- toggleSelectValue
- unexcludeMultipleValues
- unexcludeValue
- updateSort
- get

### Properties

- bind
- componentOptionsModel
- componentStateModel
- disabled
- facetSearch
- facetSettings
- logger
- queryController
- queryStateModel
- root
- searchInterface
- ID

### Accessors

- usageAnalytics

### Component Options

- additionalFilter
- allowedValues
- availableSorts
- computedField
- computedFieldCaption
- computedFieldFormat
- computedFieldOperation
- customSort
- dependsOn
- dependsOnCondition
- enableCollapse
- enableFacetSearch
- enableMoreLess
- enableSettings
- enableSettingsFacetState
- enableTogglingOperator
- facetSearchDelay
- facetSearchIgnoreAccents
- field
- id
- includeInBreadcrumb
- includeInOmnibox
- injectionDepth
- isMultiValueField
- lookupField
- numberOfValues
- numberOfValuesInBreadcrumb
- numberOfValuesInFacetSearch
- numberOfValuesInOmnibox
- paddingContainer
- pageSize
- preservePosition
- scrollContainer
- sortCriteria
- title
- useAnd
- useWildcardsInFacetSearch
- valueCaption

### Constructors

- constructor

## Methods

### collapse

- collapse(): void

- - Defined in ui/Facet/Facet.ts :1248

  #### Returns void

### debugInfo

- debugInfo(): any

- Inherited from BaseComponent.debugInfo

  - Defined in ui/Base/BaseComponent.ts :41

  #### Returns any

### deselectMultipleValues

- deselectMultipleValues(values: FacetValue[] | string[]): void

- - Defined in ui/Facet/Facet.ts :901

  #### Parameters

  - ##### values: FacetValue[] | string[]

  #### Returns void

### deselectValue

- deselectValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :887

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### disable

- disable(): void

- Inherited from BaseComponent.disable

  - Defined in ui/Base/BaseComponent.ts :52

  #### Returns void

### enable

- enable(): void

- Inherited from BaseComponent.enable

  - Defined in ui/Base/BaseComponent.ts :61

  #### Returns void

### excludeMultipleValues

- excludeMultipleValues(values: FacetValue[] | string[]): void

- - Defined in ui/Facet/Facet.ts :932

  #### Parameters

  - ##### values: FacetValue[] | string[]

  #### Returns void

### excludeValue

- excludeValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :918

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### expand

- expand(): void

- - Defined in ui/Facet/Facet.ts :1258

  #### Returns void

### getBindings

- getBindings(): IComponentBindings

- Inherited from Component.getBindings

  - Defined in ui/Base/Component.ts :328

  #### Returns IComponentBindings

### getCaptionForStringValue

- getCaptionForStringValue(value: string): string

- - Defined in ui/Facet/Facet.ts :1206

  #### Parameters

  - ##### value: string

  #### Returns string

### getDisplayedFacetValues

- getDisplayedFacetValues(): FacetValue[]

- - Defined in ui/Facet/Facet.ts :1014

  #### Returns FacetValue[]

  The currently displayed values.

### getDisplayedValues

- getDisplayedValues(): string[]

- - Defined in ui/Facet/Facet.ts :1005

  #### Returns string[]

  The currently displayed values.

### getEndpoint

- getEndpoint(): ISearchEndpoint

- - Defined in ui/Facet/Facet.ts :1088

  #### Returns ISearchEndpoint

  The endpoint for the facet.

### getExcludedValues

- getExcludedValues(): string[]

- - Defined in ui/Facet/Facet.ts :1044

  #### Returns string[]

  The currently excluded values.

### getSelectedValues

- getSelectedValues(): string[]

- - Defined in ui/Facet/Facet.ts :1026

  #### Returns string[]

  The currently selected values.

### getValueCaption

- getValueCaption(facetValue: IIndexFieldValue | FacetValue | string): string

- - Defined in ui/Facet/Facet.ts :1183

  #### Parameters

  - ##### facetValue: IIndexFieldValue | FacetValue | string

  #### Returns string

### hasSelectedValue

- hasSelectedValue(value: string): boolean

- - Defined in ui/Facet/Facet.ts :1035

  #### Parameters

  - ##### value: string

  #### Returns boolean

### hideWaitingAnimation

- hideWaitingAnimation(): void

- - Defined in ui/Facet/Facet.ts :1141

  #### Returns void

### reset

- reset(): void

- - Defined in ui/Facet/Facet.ts :1052

  #### Returns void

### selectMultipleValues

- selectMultipleValues(values: FacetValue[] | string[]): void

- - Defined in ui/Facet/Facet.ts :870

  #### Parameters

  - ##### values: FacetValue[] | string[]

  #### Returns void

### selectValue

- selectValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :856

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### showLess

- showLess(): void

- - Defined in ui/Facet/Facet.ts :1235

  #### Returns void

### showMore

- showMore(): void

- - Defined in ui/Facet/Facet.ts :1219

  #### Returns void

### showWaitingAnimation

- showWaitingAnimation(): void

- - Defined in ui/Facet/Facet.ts :1130

  #### Returns void

### switchToAnd

- switchToAnd(): void

- - Defined in ui/Facet/Facet.ts :1066

  #### Returns void

### switchToOr

- switchToOr(): void

- - Defined in ui/Facet/Facet.ts :1078

  #### Returns void

### toggleExcludeValue

- toggleExcludeValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :993

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### toggleSelectValue

- toggleSelectValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :978

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### unexcludeMultipleValues

- unexcludeMultipleValues(values: FacetValue[] | string[]): void

- - Defined in ui/Facet/Facet.ts :962

  #### Parameters

  - ##### values: FacetValue[] | string[]

  #### Returns void

### unexcludeValue

- unexcludeValue(value: FacetValue | string): void

- - Defined in ui/Facet/Facet.ts :948

  #### Parameters

  - ##### value: FacetValue | string

  #### Returns void

### updateSort

- updateSort(criteria: string): void

- - Defined in ui/Facet/Facet.ts :1101

  #### Parameters

  - ##### criteria: string

  #### Returns void

### Static get

- get(element: HTMLElement, componentClass?: any, noThrow?: boolean): BaseComponent

- Inherited from Component.get

  - Defined in ui/Base/Component.ts :410

  #### Parameters

  - ##### element: HTMLElement

  - ##### Optional componentClass: any

  - ##### Optional noThrow: boolean

  #### Returns BaseComponent

## Properties

### bind

bind: ComponentEvents

Inherited from Component.bind

- Defined in ui/Base/Component.ts :270

### componentOptionsModel

componentOptionsModel: ComponentOptionsModel

Inherited from Component.componentOptionsModel

- Defined in ui/Base/Component.ts :294

### componentStateModel

componentStateModel: ComponentStateModel

Inherited from Component.componentStateModel

- Defined in ui/Base/Component.ts :282

### disabled

disabled: boolean

Inherited from BaseComponent.disabled

- Defined in ui/Base/BaseComponent.ts :23

### facetSearch

facetSearch: FacetSearch

- Defined in ui/Facet/Facet.ts :726

### facetSettings

facetSettings: FacetSettings

- Defined in ui/Facet/Facet.ts :731

### logger

logger: Logger

Inherited from BaseComponent.logger

- Defined in ui/Base/BaseComponent.ts :18

### queryController

queryController: QueryController

Inherited from Component.queryController

- Defined in ui/Base/Component.ts :286

### queryStateModel

queryStateModel: QueryStateModel

Inherited from Component.queryStateModel

- Defined in ui/Base/Component.ts :278

### root

root: HTMLElement

Inherited from Component.root

- Defined in ui/Base/Component.ts :274

### searchInterface

searchInterface: SearchInterface

Inherited from Component.searchInterface

- Defined in ui/Base/Component.ts :290

### Static ID

ID: string

Inherited from BaseComponent.ID

- Defined in ui/Base/BaseComponent.ts :28

## Accessors

### usageAnalytics

usageAnalytics:

Inherited from Component.usageAnalytics

- Defined in ui/Base/Component.ts :343

## Component Options

### additionalFilter

additionalFilter: string

- Defined in ui/Facet/Facet.ts :623

Markup configuration example(s) :

    data-additional-filter='foo'

### allowedValues

allowedValues: string[]

- Defined in ui/Facet/Facet.ts :615

### availableSorts

availableSorts: string[] | ("occurrences" | "score" | "alphaascending" | "alphadescending" | "computedfieldascending" | "computedfielddescending" | "chisquare" | "nosort")[]

- Defined in ui/Facet/Facet.ts :261

### computedField

computedField: IFieldOption

- Defined in ui/Facet/Facet.ts :465

Markup configuration example(s) :

    data-computed-field='@foo'

### computedFieldCaption

computedFieldCaption: string

- Defined in ui/Facet/Facet.ts :513

Markup configuration example(s) :

    data-computed-field-caption='foo'

### computedFieldFormat

computedFieldFormat: "c0" | "n0" | "n2"

- Defined in ui/Facet/Facet.ts :497

### computedFieldOperation

computedFieldOperation: "sum" | "average" | "minimum" | "maximum"

- Defined in ui/Facet/Facet.ts :478

### customSort

customSort: string[]

- Defined in ui/Facet/Facet.ts :302

### dependsOn

dependsOn: string

- Defined in ui/Facet/Facet.ts :654

Markup configuration example(s) :

    data-depends-on='foo'

### dependsOnCondition

dependsOnCondition: IDependentFacetCondition

- Defined in ui/Facet/Facet.ts :665

### enableCollapse

enableCollapse: boolean

- Defined in ui/Facet/Facet.ts :593

Markup configuration example(s) :

    data-enable-collapse='true'
    data-enable-collapse='false'

### enableFacetSearch

enableFacetSearch: boolean

- Defined in ui/Facet/Facet.ts :360

Markup configuration example(s) :

    data-enable-facet-search='true'
    data-enable-facet-search='false'

### enableMoreLess

enableMoreLess: boolean

- Defined in ui/Facet/Facet.ts :573

Markup configuration example(s) :

    data-enable-more-less='true'
    data-enable-more-less='false'

### enableSettings

enableSettings: boolean

- Defined in ui/Facet/Facet.ts :228

Markup configuration example(s) :

    data-enable-settings='true'
    data-enable-settings='false'

### enableSettingsFacetState

enableSettingsFacetState: boolean

- Defined in ui/Facet/Facet.ts :238

Markup configuration example(s) :

    data-enable-settings-facet-state='true'
    data-enable-settings-facet-state='false'

### enableTogglingOperator

enableTogglingOperator: boolean

- Defined in ui/Facet/Facet.ts :343

Markup configuration example(s) :

    data-enable-toggling-operator='true'
    data-enable-toggling-operator='false'

### facetSearchDelay

facetSearchDelay: number

- Defined in ui/Facet/Facet.ts :373

Markup configuration example(s) :

    data-facet-search-delay='10'

### facetSearchIgnoreAccents

facetSearchIgnoreAccents: boolean

- Defined in ui/Facet/Facet.ts :383

Markup configuration example(s) :

    data-facet-search-ignore-accents='true'
    data-facet-search-ignore-accents='false'

### field

field: IFieldOption

- Defined in ui/Facet/Facet.ts :172

Markup configuration example(s) :

    data-field='@foo'

### id

id: string

- Defined in ui/Facet/Facet.ts :187

Markup configuration example(s) :

    data-id='foo'

### includeInBreadcrumb

includeInBreadcrumb: boolean

- Defined in ui/Facet/Facet.ts :412

Markup configuration example(s) :

    data-include-in-breadcrumb='true'
    data-include-in-breadcrumb='false'

### includeInOmnibox

includeInOmnibox: boolean

- Defined in ui/Facet/Facet.ts :434

Markup configuration example(s) :

    data-include-in-omnibox='true'
    data-include-in-omnibox='false'

### injectionDepth

injectionDepth: number

- Defined in ui/Facet/Facet.ts :319

Markup configuration example(s) :

    data-injection-depth='10'

### isMultiValueField

isMultiValueField: boolean

- Defined in ui/Facet/Facet.ts :207

Markup configuration example(s) :

    data-is-multi-value-field='true'
    data-is-multi-value-field='false'

### lookupField

lookupField: IFieldOption

- Defined in ui/Facet/Facet.ts :213

Markup configuration example(s) :

    data-lookup-field='@foo'

### numberOfValues

numberOfValues: number

- Defined in ui/Facet/Facet.ts :309

Markup configuration example(s) :

    data-number-of-values='10'

### numberOfValuesInBreadcrumb

numberOfValuesInBreadcrumb: number

- Defined in ui/Facet/Facet.ts :420

Markup configuration example(s) :

    data-number-of-values-in-breadcrumb='10'

### numberOfValuesInFacetSearch

numberOfValuesInFacetSearch: number

- Defined in ui/Facet/Facet.ts :393

Markup configuration example(s) :

    data-number-of-values-in-facet-search='10'

### numberOfValuesInOmnibox

numberOfValuesInOmnibox: number

- Defined in ui/Facet/Facet.ts :446

Markup configuration example(s) :

    data-number-of-values-in-omnibox='10'

### paddingContainer

paddingContainer: HTMLElement

- Defined in ui/Facet/Facet.ts :545

### pageSize

pageSize: number

- Defined in ui/Facet/Facet.ts :583

Markup configuration example(s) :

    data-page-size='10'

### preservePosition

preservePosition: boolean

- Defined in ui/Facet/Facet.ts :537

Markup configuration example(s) :

    data-preserve-position='true'
    data-preserve-position='false'

### scrollContainer

scrollContainer: HTMLElement

- Defined in ui/Facet/Facet.ts :562

### sortCriteria

sortCriteria: "occurrences" | "score" | "alphaascending" | "alphadescending" | "computedfieldascending" | "computedfielddescending" | "chisquare" | "nosort"

- Defined in ui/Facet/Facet.ts :284

### title

title: string

- Defined in ui/Facet/Facet.ts :159

Markup configuration example(s) :

    data-title='foo'

### useAnd

useAnd: boolean

- Defined in ui/Facet/Facet.ts :334

Markup configuration example(s) :

    data-use-and='true'
    data-use-and='false'

### useWildcardsInFacetSearch

useWildcardsInFacetSearch: boolean

- Defined in ui/Facet/Facet.ts :404

Markup configuration example(s) :

    data-use-wildcards-in-facet-search='true'
    data-use-wildcards-in-facet-search='false'

### valueCaption

valueCaption: IStringMap<string>

- Defined in ui/Facet/Facet.ts :710

## Constructors

### constructor

- new Facet(element: HTMLElement, options: IFacetOptions, bindings?: IComponentBindings, facetClassId?: string): Facet

- Overwrites Component.constructor

  - Defined in ui/Facet/Facet.ts :757

  #### Parameters

  - ##### element: HTMLElement

  - ##### options: IFacetOptions

  - ##### Optional bindings: IComponentBindings

  - ##### Default value facetClassId: string = Facet.ID

  #### Returns Facet

### Implements

- IFieldValueCompatibleFacet