Coveo FacetRange Component (CoveoFacetRange)

A FacetRange is a facet whose values are expressed as ranges.

You must set the field option to a value targeting a numeric or date field in your index for this component to work.

This component extends the Facet component and supports all Facet options except:

Not supported in

Coveo for Salesforce Free

Index

Methods

collapse

  • collapse(): void

debugInfo

  • debugInfo(): any

deselectMultipleValues

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

deselectValue

disable

  • disable(): void
  • Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

    Returns void

enable

  • enable(): void
  • Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

    Returns void

excludeMultipleValues

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

excludeValue

expand

  • expand(): void

getBindings

getCaptionForStringValue

  • getCaptionForStringValue(value: string): string

getDisplayedFacetValues

  • getDisplayedFacetValues(): FacetValue[]

getDisplayedValues

  • getDisplayedValues(): string[]

getEndpoint

  • getEndpoint(): ISearchEndpoint

getExcludedValues

  • getExcludedValues(): string[]

getSelectedValues

  • getSelectedValues(): string[]

getValueCaption

hasSelectedValue

  • hasSelectedValue(value: string): boolean

hideWaitingAnimation

  • hideWaitingAnimation(): void

reset

  • reset(): void
  • Resets the facet by un-selecting all values, un-excluding all values, and redrawing the facet.

    Returns void

selectMultipleValues

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

selectValue

showLess

  • showLess(): void

showMore

  • showMore(): void

showWaitingAnimation

  • showWaitingAnimation(): void

switchToAnd

  • switchToAnd(): void

switchToOr

  • switchToOr(): void

toggleExcludeValue

  • toggleExcludeValue(value: FacetValue | string): void
  • Toggles the exclusion state of a single value (excludes the value if it is not already excluded; un-excludes the value if it is already excluded).

    Does not trigger a query automatically.

    Parameters

    Returns void

toggleSelectValue

  • toggleSelectValue(value: FacetValue | string): void
  • Toggles the selection state of a single value (selects the value if it is not already selected; un-selects the value if it is already selected).

    Does not trigger a query automatically.

    Parameters

    Returns void

unexcludeMultipleValues

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

unexcludeValue

  • unexcludeValue(value: FacetValue | string): void

updateSort

  • updateSort(criteria: string): void

Static get

  • get(element: HTMLElement, componentClass?: any, noThrow?: boolean): BaseComponent
  • Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
    If there is multiple component bound to the current HTMLElement, you must specify the component class.

    Parameters

    • element: HTMLElement

      HTMLElement for which to get the bound component.

    • Optional componentClass: any

      Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.

    • Optional noThrow: boolean

      Boolean option to tell the method to not throw on error.

    Returns BaseComponent

Properties

bind

Allows the component to bind events and execute them only when it is enabled.

type

{Coveo.ComponentEvents}

componentOptionsModel

componentOptionsModel: ComponentOptionsModel

Contains the state of options for different components. Mainly used by ResultLink.

componentStateModel

componentStateModel: ComponentStateModel

Contains the state of different components (enabled vs disabled). Allows to get/set values. Triggers component state event when modified. Each component can listen to those events.

disabled

disabled: boolean

A disabled component will not participate in the query, or listen to ComponentEvents.

type

{boolean}

facetSearch

facetSearch: FacetSearch

Renders and handles the facet Search part of the component.

facetSettings

facetSettings: FacetSettings

Renders and handles the facet Settings part of the component

logger

logger: Logger

Allows component to log in the dev console.

queryController

queryController: QueryController

Contains the singleton that allows to trigger queries.

queryStateModel

queryStateModel: QueryStateModel

Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.

root

root: HTMLElement

A reference to the root HTMLElement (the SearchInterface).

searchInterface

searchInterface: SearchInterface

A reference to the root of every component, the SearchInterface.

Static ID

ID: string

The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton

Accessors

usageAnalytics

Component Options

dateField

dateField: boolean

Whether the specified field option value targets a date field in your index.

This allows the component to correctly build the outgoing Group By.

Default: false.

Default

false

Markup configuration example(s) :
data-date-field='true'
data-date-field='false'

ranges

ranges: IRangeValue[]

The list of range values to request (see Requesting Specific FacetRange Values).

By default, the index automatically generates range values.

Note:

The index cannot automatically generate range values for a FacetRange whose field option value references a dynamic field generated by a query function. In such a case, you must use the ranges option.

valueFormat

valueFormat: string

The format to apply to the range values. Only works for numeric values.

Some of the most commonly used formats are:

  • c0: format a numeric value as currency.
  • n0: formats a numeric value as an integer.
  • n2: formats a numeric value as a floating point number with two decimal digits.

The available formats are defined in the Globalize library.

Note: This option is ignored when the valueCaption is defined.

Default

n0

Markup configuration example(s) :
data-value-format='foo'

Constructors

constructor

Implements